Closed EronWright closed 1 month ago
Looking good! No breaking changes found. No new resources/functions.
Attention: Patch coverage is 53.84615%
with 6 lines
in your changes are missing coverage. Please review.
Project coverage is 32.34%. Comparing base (
098bd43
) to head (4138b4d
).
Files | Patch % | Lines |
---|---|---|
provider/pkg/await/await.go | 0.00% | 4 Missing :warning: |
provider/pkg/metadata/overrides.go | 77.77% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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
.