Kyverno
Medium
Policies
A Kyverno DeletingPolicy deletes batch/v1 Jobs and leaves deletionPropagationPolicy unset. What happens to the Pods of each deleted Job?
Select your answer:
Show answer and explanation
Answer: They are orphaned and stay in the cluster
Explanation
With the field unset, Kyverno sends the delete without a propagation policy, so the API server applies the resource's default. For batch/v1 Jobs that default is to orphan dependents, kept for backward compatibility, so the Pods lose their owner and remain. kubectl delete hides this because it sends Background by default; set deletionPropagationPolicy to Background or Foreground in the policy.
More medium Kyverno questions
- A Kyverno DeletingPolicy for ConfigMaps never deletes anything, and the cleanup controller logs 'skipping resource due to access restrictions'. What is missing?
- A Kyverno DeletingPolicy with schedule '0 * * * *' has never run yet. When does the cleanup controller first evaluate it?
- What happens when a resource violates a Kyverno validation policy with 'validationFailureAction' set to 'enforce'?
- What is the purpose of a generation rule in Kyverno?
- Which of the following is NOT a valid resource selection method in Kyverno policies?
- What is the purpose of the 'background' field in a Kyverno policy?