Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTEUDO-1693 automation of CRD disabling flux and helm pruning #346

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

drewwells
Copy link
Contributor

@drewwells drewwells commented Oct 28, 2024

Adds annotation and labels to prevent helm and/or flux from deleting CRDs when a helm upgrade indicates that the CRDs should delete them.

DEMO

helm upgrade --install --create-namespace --namespace db-controller db-controller-crds helm/db-controller-crds --debug --wait
history.go:56: [debug] getting history for release db-controller-crds
...
client.go:486: [debug] Starting delete for "db-controller-crds-pre" Pod
wait.go:66: [debug] beginning wait for 1 resources to be deleted with timeout of 5m0s
client.go:142: [debug] creating 1 resource(s)
client.go:712: [debug] Watching for changes to Pod db-controller-crds-pre with timeout of 5m0s
client.go:740: [debug] Add/Modify event for db-controller-crds-pre: ADDED
client.go:799: [debug] Pod db-controller-crds-pre pending
client.go:740: [debug] Add/Modify event for db-controller-crds-pre: MODIFIED
client.go:799: [debug] Pod db-controller-crds-pre pending
client.go:740: [debug] Add/Modify event for db-controller-crds-pre: MODIFIED
client.go:799: [debug] Pod db-controller-crds-pre pending
client.go:740: [debug] Add/Modify event for db-controller-crds-pre: MODIFIED
client.go:799: [debug] Pod db-controller-crds-pre pending
client.go:740: [debug] Add/Modify event for db-controller-crds-pre: MODIFIED
client.go:794: [debug] Pod db-controller-crds-pre succeeded
client.go:393: [debug] checking 0 resources for changes
client.go:442: [debug] Deleting CustomResourceDefinition "databaseclaims.persistance.atlas.infoblox.com" in namespace ...
client.go:453: [debug] Skipping delete of "databaseclaims.persistance.atlas.infoblox.com" due to annotation [helm.sh/resource-policy=keep]
client.go:442: [debug] Deleting CustomResourceDefinition "dbroleclaims.persistance.atlas.infoblox.com" in namespace ...
client.go:453: [debug] Skipping delete of "dbroleclaims.persistance.atlas.infoblox.com" due to annotation [helm.sh/resource-policy=keep]
upgrade.go:428: [debug] waiting for release db-controller-crds resources (created: 0 updated: 0  deleted: 0)
wait.go:48: [debug] beginning wait for 0 resources with timeout of 5m0s
upgrade.go:171: [debug] updating status for upgraded release for db-controller-crds
Release "db-controller-crds" has been upgraded. Happy Helming!
kubectl api-resources --api-group=persistance.atlas.infoblox.com
NAME             SHORTNAMES   APIVERSION                          NAMESPACED   KIND
databaseclaims   dbc          persistance.atlas.infoblox.com/v1   true         DatabaseClaim
dbroleclaims                  persistance.atlas.infoblox.com/v1   true         DbRoleClaim

@drewwells drewwells enabled auto-merge (squash) October 28, 2024 15:42
@drewwells drewwells merged commit e3fee53 into main Oct 28, 2024
3 checks passed
@drewwells drewwells deleted the crdUpgrades branch October 28, 2024 15:48
drewwells added a commit that referenced this pull request Oct 28, 2024
@drewwells
Copy link
Contributor Author

Copy link
Contributor

@kd7lxl kd7lxl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daniel-garcia
Copy link
Contributor

LGTM

Copy link

@jcookson-infoblox jcookson-infoblox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants