-
Notifications
You must be signed in to change notification settings - Fork 117
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
new annotation: deletionPropagationPolicy
#3011
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3011 +/- ##
==========================================
+ Coverage 32.29% 32.34% +0.05%
==========================================
Files 69 69
Lines 8947 8954 +7
==========================================
+ Hits 2889 2896 +7
Misses 5791 5791
Partials 267 267 ☔ View full report in Codecov by Sentry. |
pulumi.com/deletionPropagationPolicy
pulumi.com/deletionPropagationPolicy
deletionPropagationPolicy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/kubernetes](https://pulumi.com) ([source](https://togithub.com/pulumi/pulumi-kubernetes)) | dependencies | minor | [`4.11.0` -> `4.12.0`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.11.0/4.12.0) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>pulumi/pulumi-kubernetes (@​pulumi/kubernetes)</summary> ### [`v4.12.0`](https://togithub.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#4120-May-21-2024) [Compare Source](https://togithub.com/pulumi/pulumi-kubernetes/compare/v4.11.0...v4.12.0) ##### Added - Added a new Helm Chart v4 resource. ([https://github.com/pulumi/pulumi-kubernetes/pull/2947](https://togithub.com/pulumi/pulumi-kubernetes/pull/2947)) - Added support for deletion propagation policies (e.g. Orphan). ([https://github.com/pulumi/pulumi-kubernetes/pull/3011](https://togithub.com/pulumi/pulumi-kubernetes/pull/3011)) - Server-side apply conflict errors now include the original field manager's name. ([https://github.com/pulumi/pulumi-kubernetes/pull/2983](https://togithub.com/pulumi/pulumi-kubernetes/pull/2983)) ##### Changed - Pulumi will now wait for DaemonSets to become ready. ([https://github.com/pulumi/pulumi-kubernetes/pull/2953](https://togithub.com/pulumi/pulumi-kubernetes/pull/2953)) - The Release resource's merge behavior for `valueYamlFiles` now more closely matches Helm's behavior. ([https://github.com/pulumi/pulumi-kubernetes/pull/2963](https://togithub.com/pulumi/pulumi-kubernetes/pull/2963)) ##### Fixed - Helm Chart V3 previews no longer fail when the cluster is unreachable. ([https://github.com/pulumi/pulumi-kubernetes/pull/2992](https://togithub.com/pulumi/pulumi-kubernetes/pull/2992)) - Fixed a panic that could occur when a missing field became `null`. ([https://github.com/pulumi/pulumi-kubernetes/issues/1970](https://togithub.com/pulumi/pulumi-kubernetes/issues/1970)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNzEuMSIsInVwZGF0ZWRJblZlciI6IjM3LjM3MS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL21pbm9yIl19--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Proposed changes
Introduces a new Pulumi annotation to set the deletion propagation policy, e.g. to support non-cascading delete on
StatefulSet
to preserve pods during replacement (see walkthrough).Note that the policy annotation must be set on the old resource before deleting or replacing it; setting it on the replacement or on the live object is ineffective.
Related issues (optional)
Closes #1831
Example
This example serves to show how the 'orphan' propagation policy allows for non-disruptive replacement of
a StatefulSet, e.g. by touching the
volumeClaimTemplates
.Following the initial deployment, we have these objects:
To provoke a replacement, we change the PVC template:
Let's also increase the replicas:
And deploy:
Looking again at the objects:
We see the expected result: the StatefulSet was replaced, the existing pod was adopted, and a new pod was added w/ a PVC.
In more detail, the StatefulSet controller uses the selector to identify existing pods, then chooses to delete or adopt based on suitability. Note the updated owner reference on
nginx-0
:To demonstrate how the StatefulSet controller might choose to delete the existing pod rather than adopting it, let's change the image rather than the replicas:
We deploy again and see that all pods were replaced.
Note that PVC
nginx-nginx-0
was not replaced and still hasstorage: 1Gi
.