PostgresCluster and PostgresDatabase events emitting#1798
Draft
limak9182 wants to merge 8 commits intofeature/database-controllersfrom
Draft
PostgresCluster and PostgresDatabase events emitting#1798limak9182 wants to merge 8 commits intofeature/database-controllersfrom
limak9182 wants to merge 8 commits intofeature/database-controllersfrom
Conversation
Contributor
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
…to feature/postgrescluster-and-postgresdatabase-events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add Kubernetes event emission to PostgresCluster and PostgresDatabase controllers for improved observability. Events are emitted on key lifecycle transitions (create, update, delete, ready) and on failures, making it easier to debug issues via
kubectl describeorkubectl get events.Key Changes
Testing and Verification
I tested changes manually with following scenerios:
4.1. Cluster
⎿ LAST SEEN TYPE REASON OBJECT MESSAGE 29s Normal SecretReady postgrescluster/ev4 Superuser secret ev4-secret created 29s Normal ClusterCreationStarted postgrescluster/ev4 CNPG cluster created, waiting for healthy state 10s Normal ConfigMapReady postgrescluster/ev4 ConfigMap ev4-configmap created 10s Normal ClusterReady postgrescluster/ev4 Cluster is up and running4.2 Postgresdatabase
⎿ LAST SEEN TYPE REASON OBJECT MESSAGE 24s Normal ClusterValidated postgresdatabase/ev4-db Referenced PostgresCluster is ready 24s Normal SecretsReady postgresdatabase/ev4-db All secrets provisioned for 1 databases 24s Normal ConfigMapsReady postgresdatabase/ev4-db All ConfigMaps provisioned for 1 databases 24s Normal RoleReconciliationStarted postgresdatabase/ev4-db Patched managed roles, waiting for 2 roles to reconcile 9s Normal RolesReady postgresdatabase/ev4-db All 2 roles reconciled 9s Normal DatabaseReconciliationStarted postgresdatabase/ev4-db Reconciling 1 databases, waiting for readiness 9s Normal DatabasesReady postgresdatabase/ev4-db All 1 databases ready 8s Normal PrivilegesReady postgresdatabase/ev4-db RW role privileges granted for all 1 databases 8s Normal PostgresDatabaseReady postgresdatabase/ev4-db PostgresDatabase ev4-db is ready5.1. Cluster
24s Normal ClusterReady postgrescluster/ev4 Cluster is up and running 5s Normal CleanupComplete postgrescluster/ev4 Cleanup complete (policy: Retain)5.2. Database
35s Normal DatabasesReady postgresdatabase/ev4-db All 2 databases ready 6s Normal CleanupComplete postgresdatabase/ev4-db Cleanup complete (0 retained, 2 deleted)6.1. Cluster
⎿ LAST SEEN TYPE REASON OBJECT MESSAGE 109s Normal ClusterAdopted postgrescluster/adopt-test Adopted existing CNPG cluster and secret adopt-test-secret 109s Normal ClusterCreationStarted postgrescluster/adopt-test CNPG cluster created, waiting for healthy state 90s Normal ConfigMapReady postgrescluster/adopt-test ConfigMap adopt-test-configmap created 90s Normal ClusterReady postgrescluster/adopt-test Cluster is up and running 55s Normal CleanupComplete postgrescluster/adopt-test Cleanup complete (policy: Retain) 16s Normal ClusterAdopted postgrescluster/adopt-test Adopted existing CNPG cluster and secret adopt-test-secret 16s Normal ConfigMapReady postgrescluster/adopt-test ConfigMap adopt-test-configmap created 16s Normal ClusterReady postgrescluster/adopt-test Cluster is up and running6.2. Database
18s Normal ClusterValidated postgresdatabase/adopt-db Referenced PostgresCluster is ready 18s Normal SecretsReady postgresdatabase/adopt-db All secrets provisioned for 1 databases 18s Normal ConfigMapsReady postgresdatabase/adopt-db All ConfigMaps provisioned for 1 databases 18s Normal RoleReconciliationStarted postgresdatabase/adopt-db Patched managed roles, waiting for 2 roles to reconcile 18s Normal RolesReady postgresdatabase/adopt-db All 2 roles reconciled 18s Normal ResourcesAdopted postgresdatabase/adopt-db Adopted retained databases: [adoptdb1] 18s Normal DatabasesReady postgresdatabase/adopt-db All 1 databases ready 18s Normal PrivilegesReady postgresdatabase/adopt-db RW role privileges granted for all 1 databases 18s Normal PostgresDatabaseReady postgresdatabase/adopt-db PostgresDatabase adopt-db is readyRelated Issues
CPI-1852
PR Checklist