Skip to content

Implement WaitForTermination deletion policy #1444

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

Merged
merged 4 commits into from
May 23, 2025

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented May 13, 2025

The WaitForTermination deletion policy blocks and waits for the managed resources to be removed from etcd by the Kubernetes garbage collector. The wait time is determined by the .spec.timeout field. If a timeout occurs, the controller will log an error and will allow the Kustomization to be deleted while the managed resources will be left in the cluster.

Example:

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: podinfo
  namespace: default
spec:
  interval: 30m
  retryInterval: 5m
  targetNamespace: default
  sourceRef:
    kind: GitRepository
    name: podinfo
  path: "./kustomize"
  deletionPolicy: WaitForTermination
  prune: true
  timeout: 2m

Fix: #711

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan requested a review from matheuscscp May 13, 2025 11:30
@stefanprodan stefanprodan added enhancement New feature or request area/api API related issues and pull requests labels May 13, 2025
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan force-pushed the gc-wait-for-termination branch from 0495258 to 413118e Compare May 13, 2025 13:31
Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

LGTM

@stefanprodan stefanprodan merged commit 55be958 into main May 23, 2025
5 checks passed
@stefanprodan stefanprodan deleted the gc-wait-for-termination branch May 23, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api API related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Garbage collection concurrency issue
2 participants