# Kyverno quiz questions

> 70 multiple-choice questions on policy as code with validate, mutate, generate, verifyImages and cleanup rules, with answers and explanations.

Quiz page: https://k8wiz.com/kyverno/difficulty

## Beginner (Easy): 24 questions

Interactive quiz: https://k8wiz.com/kyverno/quiz/easy

### What is Kyverno?

Kyverno, Easy (Beginner), Architecture. https://k8wiz.com/uquiz/what-is-kyverno

- A. A Kubernetes monitoring tool
- B. A policy engine designed for Kubernetes
- C. A container runtime for Kubernetes
- D. A deployment tool for Kubernetes applications

**Answer:** A policy engine designed for Kubernetes

**Explanation:** Kyverno is a policy engine designed specifically for Kubernetes. It allows you to validate, mutate, and generate Kubernetes resources using policies as Kubernetes resources themselves, without requiring a new language.

### Which Kubernetes resource type does Kyverno use to define policies?

Kyverno, Easy (Beginner), Architecture. https://k8wiz.com/uquiz/which-kubernetes-resource-type-does-kyverno-use-to-define-policies

- A. ConfigMap
- B. CustomResourceDefinition (CRD)
- C. Secret
- D. Deployment

**Answer:** CustomResourceDefinition (CRD)

**Explanation:** Kyverno uses CustomResourceDefinitions (CRDs) to define policies. This allows policies to be managed as native Kubernetes resources using kubectl and other Kubernetes tools.

### What are the three main types of rules in Kyverno policies?

Kyverno, Easy (Beginner), Policies. https://k8wiz.com/uquiz/what-are-the-three-main-types-of-rules-in-kyverno-policies

- A. Create, Update, Delete
- B. Validate, Mutate, Generate
- C. Allow, Deny, Audit
- D. Warn, Block, Report

**Answer:** Validate, Mutate, Generate

**Explanation:** Kyverno policies can contain three types of rules: validate (to check if resources meet certain criteria), mutate (to modify resources), and generate (to create additional resources).

### Which command is used to install Kyverno in a Kubernetes cluster?

Kyverno, Easy (Beginner), CLI. https://k8wiz.com/uquiz/which-command-is-used-to-install-kyverno-in-a-kubernetes-cluster

- A. kubectl install kyverno
- B. helm install kyverno kyverno/kyverno
- C. kyverno install
- D. kubectl apply -f kyverno.yaml

**Answer:** helm install kyverno kyverno/kyverno

**Explanation:** The recommended way to install Kyverno is using Helm. The command 'helm install kyverno kyverno/kyverno' installs Kyverno from the official Helm chart repository.

### What is the purpose of a validation rule in Kyverno?

Kyverno, Easy (Beginner), Validation. https://k8wiz.com/uquiz/what-is-the-purpose-of-a-validation-rule-in-kyverno

- A. To modify resources before they are stored in the Kubernetes API
- B. To check if resources meet specific criteria
- C. To create additional resources based on a trigger resource
- D. To delete non-compliant resources

**Answer:** To check if resources meet specific criteria

**Explanation:** Validation rules in Kyverno are used to check if Kubernetes resources meet specific criteria. They can enforce security best practices, organizational standards, or other requirements.

### What is the purpose of a mutation rule in Kyverno?

Kyverno, Easy (Beginner), Mutation. https://k8wiz.com/uquiz/what-is-the-purpose-of-a-mutation-rule-in-kyverno

- A. To validate resource configurations
- B. To modify resources before they are stored in the Kubernetes API
- C. To generate new resources based on existing ones
- D. To delete non-compliant resources

**Answer:** To modify resources before they are stored in the Kubernetes API

**Explanation:** Mutation rules in Kyverno are used to modify resources before they are stored in the Kubernetes API. This can be used to add default values, labels, annotations, or make other changes to ensure compliance with organizational standards.

### Which command is used to test a Kyverno policy against a resource without applying it to the cluster?

Kyverno, Easy (Beginner), CLI. https://k8wiz.com/uquiz/which-command-is-used-to-test-a-kyverno-policy-against-a-resource-without-applying-it-to-the-cluster

- A. kubectl validate -f policy.yaml
- B. kyverno apply policy.yaml resource.yaml --dry-run
- C. kyverno test policy.yaml resource.yaml
- D. kubectl test policy.yaml against resource.yaml

**Answer:** kyverno test policy.yaml resource.yaml

**Explanation:** The 'kyverno test' command is used to test a policy against a resource without applying it to the cluster. This is useful for policy development and testing.

### Which Kubernetes API group does Kyverno use for its resources?

Kyverno, Easy (Beginner), Architecture. https://k8wiz.com/uquiz/which-kubernetes-api-group-does-kyverno-use-for-its-resources

- A. kyverno.io
- B. policy.kyverno.io
- C. kyverno.kubernetes.io
- D. policies.kyverno.io

**Answer:** kyverno.io

**Explanation:** Kyverno uses the API group 'kyverno.io' for its resources. For example, a Policy resource would be of kind 'Policy' in the 'kyverno.io' API group.

### What is the difference between a ClusterPolicy and a Policy in Kyverno?

Kyverno, Easy (Beginner), Policies. https://k8wiz.com/uquiz/what-is-the-difference-between-a-clusterpolicy-and-a-policy-in-kyverno

- A. ClusterPolicy applies to all namespaces, while Policy applies to a specific namespace
- B. ClusterPolicy is for cluster administrators, while Policy is for regular users
- C. ClusterPolicy is for validation, while Policy is for mutation
- D. ClusterPolicy is deprecated, and Policy should be used instead

**Answer:** ClusterPolicy applies to all namespaces, while Policy applies to a specific namespace

**Explanation:** A ClusterPolicy in Kyverno applies to resources across all namespaces in the cluster, while a Policy applies only to resources in the same namespace as the Policy itself.

### Which of the following is NOT a valid rule type in a Kyverno policy?

Kyverno, Easy (Beginner), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-not-a-valid-rule-type-in-a-kyverno-policy

- A. validate
- B. mutate
- C. generate
- D. enforce

**Answer:** enforce

**Explanation:** The valid rule types in a Kyverno policy are 'validate', 'mutate', and 'generate'. 'Enforce' is not a valid rule type, but rather a value for the 'validationFailureAction' field.

### Which command is used to generate a policy from a resource?

Kyverno, Easy (Beginner), CLI. https://k8wiz.com/uquiz/which-command-is-used-to-generate-a-policy-from-a-resource

- A. kubectl generate policy from resource.yaml
- B. kyverno generate-policy resource.yaml
- C. kyverno create policy resource.yaml
- D. kubectl kyverno generate resource.yaml

**Answer:** kyverno generate-policy resource.yaml

**Explanation:** The 'kyverno generate-policy' command is used to generate a policy from a resource. This is useful for creating policies based on existing resources that you want to standardize.

### Which command is used to check if Kyverno is ready in a Kubernetes cluster?

Kyverno, Easy (Beginner), CLI. https://k8wiz.com/uquiz/which-command-is-used-to-check-if-kyverno-is-ready-in-a-kubernetes-cluster

- A. kubectl get kyverno
- B. kyverno status
- C. kubectl get pods -n kyverno
- D. kubectl kyverno check

**Answer:** kubectl get pods -n kyverno

**Explanation:** To check if Kyverno is ready in a Kubernetes cluster, you can use the command 'kubectl get pods -n kyverno' to see if the Kyverno pods are running. There is no specific 'kyverno status' or 'kubectl kyverno check' command.

### Which apiVersion does a Kyverno CLI kyverno-test.yaml file use?

Kyverno, Easy (Beginner), Testing. https://k8wiz.com/uquiz/which-apiversion-does-a-kyverno-cli-kyverno-testyaml-file-use

- A. kyverno.io/v1
- B. cli.kyverno.io/v1alpha1
- C. policies.kyverno.io/v1
- D. test.kyverno.io/v1beta1

**Answer:** cli.kyverno.io/v1alpha1

**Explanation:** Test files are manifests of kind Test with apiVersion cli.kyverno.io/v1alpha1 and a metadata.name. The CLI rejects files that leave out apiVersion and kind, or that still use the old top-level name field, as a deprecated schema. kyverno.io/v1 and policies.kyverno.io/v1 are the API groups of the policies themselves.

### What does kyverno test do when an actual policy result doesn't match the expected one?

Kyverno, Easy (Beginner), Testing. https://k8wiz.com/uquiz/what-does-kyverno-test-do-when-an-actual-policy-result-doesnt-match-the-expected-one

- A. It exits with a non-zero status
- B. It exits with status 0 and a warning
- C. It rewrites the expected result to match
- D. It retries the test until the results match

**Answer:** It exits with a non-zero status

**Explanation:** The CLI marks the mismatched row as failed, prints a summary with the failure count and returns an error, so the process exits non-zero. That's what lets a CI job fail when a policy change breaks an expected result. It never changes the test file.

### In a kyverno-test.yaml file, which expected result do you write for a resource the policy should block?

Kyverno, Easy (Beginner), Testing. https://k8wiz.com/uquiz/in-a-kyverno-testyaml-file-which-expected-result-do-you-write-for-a-resource-the-policy-should-block

- A. deny
- B. block
- C. reject
- D. fail

**Answer:** fail

**Explanation:** Expected results use the policy report values pass, fail, warn, error and skip. A resource that violates a validation is reported as fail, even when the policy would deny it at admission. skip is the expected result for a resource covered by a policy exception.

### What happens to an existing ClusterPolicy when a cluster is upgraded to Kyverno 1.20?

Kyverno, Easy (Beginner), Policies. https://k8wiz.com/uquiz/what-happens-to-an-existing-clusterpolicy-when-a-cluster-is-upgraded-to-kyverno-120

- A. Kyverno converts it to a ValidatingPolicy
- B. It stays in the cluster but is not enforced
- C. Kyverno deletes it during the upgrade
- D. It keeps working until the next minor release

**Answer:** It stays in the cluster but is not enforced

**Explanation:** Kyverno 1.20 no longer runs ClusterPolicy, Policy, CleanupPolicy, ClusterCleanupPolicy or the kyverno.io PolicyException. The CRDs stay installed, so you can still list, export and delete the objects, but their rules do nothing. Nothing converts them for you; you migrate them to the policies.kyverno.io types yourself.

### Which validationActions value makes a Kyverno ValidatingPolicy reject a request that fails a validation?

Kyverno, Easy (Beginner), Validation. https://k8wiz.com/uquiz/which-validationactions-value-makes-a-kyverno-validatingpolicy-reject-a-request-that-fails-a-validation

- A. Enforce
- B. Warn
- C. Audit
- D. Deny

**Answer:** Deny

**Explanation:** ValidatingPolicy accepts Deny, Audit and Warn in spec.validationActions, the same values as a Kubernetes ValidatingAdmissionPolicy binding. Deny blocks the request, Audit only records the result in policy reports and Warn returns a warning to the client. Enforce is the old validationFailureAction value from ClusterPolicy and is not valid here.

### When you migrate a ClusterPolicy to the CEL-based types, which kind replaces a generate rule?

Kyverno, Easy (Beginner), Generation. https://k8wiz.com/uquiz/when-you-migrate-a-clusterpolicy-to-the-cel-based-types-which-kind-replaces-a-generate-rule

- A. GeneratingPolicy
- B. MutatingPolicy
- C. DeletingPolicy
- D. ValidatingPolicy

**Answer:** GeneratingPolicy

**Explanation:** Each CEL-based policy type does one job. Validate rules become ValidatingPolicy, mutate rules become MutatingPolicy, generate rules become GeneratingPolicy and verifyImages rules become ImageValidatingPolicy. DeletingPolicy replaces CleanupPolicy, not generate rules.

### Which CEL function does a Kyverno GeneratingPolicy call in a generate expression to create resources in a namespace?

Kyverno, Easy (Beginner), Generation. https://k8wiz.com/uquiz/which-cel-function-does-a-kyverno-generatingpolicy-call-in-a-generate-expression-to-create-resources-in-a-namespace

- A. generator.Apply(namespace, [resources])
- B. resource.Create(namespace, [resources])
- C. generate.Resource(namespace, [resources])
- D. kyverno.Generate(namespace, [resources])

**Answer:** generator.Apply(namespace, [resources])

**Explanation:** The GeneratingPolicy generator library provides generator.Apply, which takes a target namespace and a list of resource objects and creates them there. It returns true on success, so it also works inside CEL loops such as list.all(...). resource.Get and resource.List exist, but they only fetch source objects for cloning.

### A GeneratingPolicy defines a NetworkPolicy inline and has evaluation.synchronize.enabled set to true. What happens when someone deletes the generated NetworkPolicy?

Kyverno, Easy (Beginner), Generation. https://k8wiz.com/uquiz/a-generatingpolicy-defines-a-networkpolicy-inline-and-has-evaluationsynchronizeenabled-set-to-true-what-happens-when-someone-del

- A. It stays deleted until the namespace is recreated
- B. Kyverno recreates it from the policy
- C. Kyverno deletes the trigger namespace as well
- D. Kyverno disables the policy and reports an error

**Answer:** Kyverno recreates it from the policy

**Explanation:** With synchronization on, the downstream resource is tied to the policy and its trigger, so Kyverno recreates a deleted downstream object and reverts manual edits to it. Without synchronization, a deleted downstream object simply stays deleted.

### In a Kyverno GeneratingPolicy template entry, which interpolate value makes Kyverno evaluate (( ... )) placeholders in the YAML?

Kyverno, Easy (Beginner), Generation. https://k8wiz.com/uquiz/in-a-kyverno-generatingpolicy-template-entry-which-interpolate-value-makes-kyverno-evaluate-placeholders-in-the-yaml

- A. none
- B. yaml
- C. cel
- D. jmespath

**Answer:** cel

**Explanation:** template.interpolate accepts none or cel. With cel, Kyverno evaluates every (( ... )) placeholder as a CEL expression before it parses the YAML. The default is none, which treats template.value as plain YAML and leaves placeholders untouched.

### Which two patchType values does a mutation in a Kyverno MutatingPolicy accept?

Kyverno, Easy (Beginner), Mutation. https://k8wiz.com/uquiz/which-two-patchtype-values-does-a-mutation-in-a-kyverno-mutatingpolicy-accept

- A. StrategicMergePatch and JSONPatch
- B. ApplyConfiguration and JSONPatch
- C. ApplyConfiguration and MergePatch
- D. Overlay and JSONPatch

**Answer:** ApplyConfiguration and JSONPatch

**Explanation:** MutatingPolicy follows the Kubernetes MutatingAdmissionPolicy, whose mutations use either an ApplyConfiguration expression that returns a partial object to merge or a JSONPatch expression that returns RFC 6902 operations. Legacy patchStrategicMerge overlays are not supported and have to be rewritten as one of these two.

### Which Kyverno kind lets a namespace owner write mutation rules that apply only to resources in that namespace?

Kyverno, Easy (Beginner), Policies. https://k8wiz.com/uquiz/which-kyverno-kind-lets-a-namespace-owner-write-mutation-rules-that-apply-only-to-resources-in-that-namespace

- A. MutatingPolicy with a namespaceSelector
- B. PolicyException
- C. MutatingAdmissionPolicyBinding
- D. NamespacedMutatingPolicy

**Answer:** NamespacedMutatingPolicy

**Explanation:** NamespacedMutatingPolicy has the same fields as MutatingPolicy but is namespace-scoped and only affects resources in its own namespace, so teams can manage it without cluster-wide rights. A MutatingPolicy is cluster-scoped even when a namespaceSelector narrows what it matches.

### In a Kyverno MutatingPolicy, which field turns on mutation of resources that already exist in the cluster?

Kyverno, Easy (Beginner), Mutation. https://k8wiz.com/uquiz/in-a-kyverno-mutatingpolicy-which-field-turns-on-mutation-of-resources-that-already-exist-in-the-cluster

- A. spec.evaluation.mutateExisting.enabled
- B. spec.evaluation.background.enabled
- C. spec.mutateExistingOnPolicyUpdate
- D. spec.evaluation.generateExisting.enabled

**Answer:** spec.evaluation.mutateExisting.enabled

**Explanation:** mutateExisting.enabled defaults to false. When it is true, the background controller mutates existing resources, using targetMatchConstraints if set and matchConstraints otherwise. background.enabled controls whether the policy is applied during background scans, and generateExisting belongs to GeneratingPolicy.

## Advanced (Medium): 22 questions

Interactive quiz: https://k8wiz.com/kyverno/quiz/medium

### What happens when a resource violates a Kyverno validation policy with 'validationFailureAction' set to 'enforce'?

Kyverno, Medium (Advanced), Validation. https://k8wiz.com/uquiz/what-happens-when-a-resource-violates-a-kyverno-validation-policy-with-validationfailureaction-set-to-enforce

- A. The resource is automatically fixed to comply with the policy
- B. The resource is rejected and not admitted to the cluster
- C. The resource is admitted but marked as non-compliant
- D. The resource is admitted and a warning event is generated

**Answer:** The resource is rejected and not admitted to the cluster

**Explanation:** When 'validationFailureAction' is set to 'enforce', resources that violate the policy are rejected and not admitted to the cluster. This is the strictest enforcement level.

### What is the purpose of a generation rule in Kyverno?

Kyverno, Medium (Advanced), Generation. https://k8wiz.com/uquiz/what-is-the-purpose-of-a-generation-rule-in-kyverno

- A. To generate documentation for policies
- B. To create additional resources based on a trigger resource
- C. To generate reports on policy violations
- D. To create new versions of existing resources

**Answer:** To create additional resources based on a trigger resource

**Explanation:** Generation rules in Kyverno are used to create additional resources when a matching resource is created or updated. For example, creating a NetworkPolicy whenever a new Namespace is created.

### Which of the following is NOT a valid resource selection method in Kyverno policies?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-not-a-valid-resource-selection-method-in-kyverno-policies

- A. resources.kinds
- B. resources.namespaces
- C. resources.names
- D. resources.priorities

**Answer:** resources.priorities

**Explanation:** Kyverno policies can select resources using kinds, namespaces, and names, but 'resources.priorities' is not a valid selection method. The valid methods are kinds, namespaces, names, selectors, and annotations.

### What is the purpose of the 'background' field in a Kyverno policy?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-background-field-in-a-kyverno-policy

- A. To run the policy in the background with lower priority
- B. To apply the policy to existing resources in addition to newly created ones
- C. To make the policy invisible to regular users
- D. To run the policy only when the cluster is idle

**Answer:** To apply the policy to existing resources in addition to newly created ones

**Explanation:** The 'background' field, when set to true, applies the policy to existing resources in addition to newly created or updated ones. This is useful for ensuring all resources in the cluster comply with the policy, not just new ones.

### What is the purpose of the 'validationFailureAction' field in a Kyverno policy?

Kyverno, Medium (Advanced), Validation. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-validationfailureaction-field-in-a-kyverno-policy

- A. To specify what happens when a policy fails to validate
- B. To specify what happens when a resource fails validation
- C. To specify what happens when Kyverno fails to start
- D. To specify what happens when a policy cannot be applied

**Answer:** To specify what happens when a resource fails validation

**Explanation:** The 'validationFailureAction' field specifies what happens when a resource fails validation against a policy. It can be set to 'enforce' (reject the resource) or 'audit' (allow the resource but report the violation).

### Which of the following is a valid JMESPath expression in a Kyverno policy?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-a-valid-jmespath-expression-in-a-kyverno-policy

- A. metadata.name == 'nginx'
- B. spec.containers[*].image contains 'latest'
- C. request.object.metadata.name == 'nginx'
- D. {{request.object.metadata.name}} == 'nginx'

**Answer:** request.object.metadata.name == 'nginx'

**Explanation:** Kyverno uses JMESPath expressions for conditions and pattern matching. 'request.object.metadata.name == 'nginx'' is a valid JMESPath expression that checks if the name of the resource is 'nginx'.

### What is the purpose of the 'exclude' field in a Kyverno policy?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-exclude-field-in-a-kyverno-policy

- A. To exclude certain users from seeing the policy
- B. To exclude certain resources from being subject to the policy
- C. To exclude certain rules from being applied
- D. To exclude certain namespaces from Kyverno's scope

**Answer:** To exclude certain resources from being subject to the policy

**Explanation:** The 'exclude' field in a Kyverno policy is used to exclude certain resources from being subject to the policy, even if they match the 'match' criteria. This is useful for creating exceptions to policy rules.

### What is the purpose of the 'preconditions' field in a Kyverno rule?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-preconditions-field-in-a-kyverno-rule

- A. To specify conditions that must be met before Kyverno starts
- B. To specify conditions that must be met before the rule is applied
- C. To specify conditions that must be met before the cluster is created
- D. To specify conditions that must be met before a resource is created

**Answer:** To specify conditions that must be met before the rule is applied

**Explanation:** The 'preconditions' field in a Kyverno rule specifies conditions that must be met before the rule is applied to a resource. If the preconditions are not met, the rule is skipped.

### Which of the following is a valid pattern matching syntax in Kyverno?

Kyverno, Medium (Advanced), Validation. https://k8wiz.com/uquiz/which-of-the-following-is-a-valid-pattern-matching-syntax-in-kyverno

- A. metadata.name: regex('^test-.*$')
- B. metadata.name: startsWith('test-')
- C. metadata.name: ?*
- D. metadata.name: {{ regex('^test-.*$') }}

**Answer:** metadata.name: regex('^test-.*$')

**Explanation:** Kyverno supports pattern matching using the 'regex' function. The syntax 'metadata.name: regex('^test-.*$')' is valid and matches any resource name that starts with 'test-'.

### What is the purpose of the 'audit' value for 'validationFailureAction' in a Kyverno policy?

Kyverno, Medium (Advanced), Validation. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-audit-value-for-validationfailureaction-in-a-kyverno-policy

- A. To log all policy evaluations for auditing purposes
- B. To allow resources that violate the policy but report the violations
- C. To audit the policy itself for correctness
- D. To enable external auditing of the cluster

**Answer:** To allow resources that violate the policy but report the violations

**Explanation:** When 'validationFailureAction' is set to 'audit', resources that violate the policy are still admitted to the cluster, but the violations are reported. This is useful for monitoring compliance without blocking operations.

### What is the purpose of the 'synchronize' field in a Kyverno generate rule?

Kyverno, Medium (Advanced), Generation. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-synchronize-field-in-a-kyverno-generate-rule

- A. To synchronize the policy across multiple clusters
- B. To keep the generated resource in sync with changes to the source resource
- C. To synchronize the policy with the Kubernetes API server
- D. To ensure all controllers are synchronized

**Answer:** To keep the generated resource in sync with changes to the source resource

**Explanation:** The 'synchronize' field in a Kyverno generate rule, when set to true, keeps the generated resource in sync with changes to the source resource. If the source resource changes, the generated resource is updated accordingly.

### Which of the following is NOT a valid operation in a Kyverno mutate rule?

Kyverno, Medium (Advanced), Mutation. https://k8wiz.com/uquiz/which-of-the-following-is-not-a-valid-operation-in-a-kyverno-mutate-rule

- A. add
- B. replace
- C. merge
- D. remove

**Answer:** merge

**Explanation:** patchesJson6902 in a mutate rule uses RFC 6902 JSON Patch, whose operations are add, remove, replace, move, copy and test. There is no merge operation; to merge fields, Kyverno offers patchStrategicMerge, which works like kubectl's strategic merge patches.

### What is the purpose of the 'policyReport' resource in Kyverno?

Kyverno, Medium (Advanced), Architecture. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-policyreport-resource-in-kyverno

- A. To report on the status of policies in the cluster
- B. To report on policy violations by resources
- C. To report on the performance of Kyverno
- D. To report on the usage of policies

**Answer:** To report on policy violations by resources

**Explanation:** The 'policyReport' resource in Kyverno is used to report on policy violations by resources. It provides a summary of which resources violate which policies, helping administrators identify and address compliance issues.

### Which of the following is a valid way to exclude system namespaces in a Kyverno policy?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-a-valid-way-to-exclude-system-namespaces-in-a-kyverno-policy

- A. exclude.namespaces: [kube-system, kube-public]
- B. exclude: { namespaces: [kube-system, kube-public] }
- C. excludeNamespaces: [kube-system, kube-public]
- D. namespaces.exclude: [kube-system, kube-public]

**Answer:** exclude: { namespaces: [kube-system, kube-public] }

**Explanation:** The correct syntax to exclude system namespaces in a Kyverno policy is 'exclude: { namespaces: [kube-system, kube-public] }'. This excludes resources in the kube-system and kube-public namespaces from being subject to the policy.

### What is the purpose of the 'match.resources.selector' field in a Kyverno policy?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-matchresourcesselector-field-in-a-kyverno-policy

- A. To select which Kubernetes resources the policy applies to based on labels
- B. To select which users can see the policy
- C. To select which namespaces the policy applies to
- D. To select which clusters the policy applies to

**Answer:** To select which Kubernetes resources the policy applies to based on labels

**Explanation:** The 'match.resources.selector' field in a Kyverno policy is used to select which Kubernetes resources the policy applies to based on their labels. This allows for fine-grained control over which resources are subject to the policy.

### What is the purpose of the 'kyverno.io/ignore' annotation?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-kyvernoioignore-annotation

- A. To mark a policy to be ignored by Kyverno
- B. To mark a resource to be ignored by specific Kyverno policies
- C. To ignore errors in policy evaluation
- D. To ignore certain fields in a resource during validation

**Answer:** To mark a resource to be ignored by specific Kyverno policies

**Explanation:** The 'kyverno.io/ignore' annotation can be added to a resource to make it be ignored by specific Kyverno policies. The value of the annotation should be a comma-separated list of policy names to ignore.

### Which of the following is a valid way to use a variable in a Kyverno policy pattern?

Kyverno, Medium (Advanced), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-a-valid-way-to-use-a-variable-in-a-kyverno-policy-pattern

- A. metadata.name: $(var1)
- B. metadata.name: {{var1}}
- C. metadata.name: {{ context.var1 }}
- D. metadata.name: ${var1}

**Answer:** metadata.name: {{var1}}

**Explanation:** Kyverno variables are JMESPath expressions in double braces. A context entry named var1 is referenced as {{var1}}, and request data as {{request.object.metadata.name}}. ${var1} is Flux and shell syntax, and $( ) in a pattern refers to another field of the same resource, not to a variable.

### What is the purpose of the 'kyverno.io/generated-by' annotation?

Kyverno, Medium (Advanced), Generation. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-kyvernoiogenerated-by-annotation

- A. To indicate which user generated a policy
- B. To indicate which policy generated a resource
- C. To indicate which version of Kyverno generated a resource
- D. To indicate which cluster generated a resource

**Answer:** To indicate which policy generated a resource

**Explanation:** The 'kyverno.io/generated-by' annotation is added to resources generated by Kyverno to indicate which policy generated the resource. This helps track the source of generated resources.

### In a kyverno-test.yaml results entry, which field marks the result as coming from a CEL-based ValidatingPolicy?

Kyverno, Medium (Advanced), Testing. https://k8wiz.com/uquiz/in-a-kyverno-testyaml-results-entry-which-field-marks-the-result-as-coming-from-a-cel-based-validatingpolicy

- A. kind: ValidatingPolicy
- B. policyType: ValidatingPolicy
- C. isValidatingPolicy: true
- D. engine: cel

**Answer:** isValidatingPolicy: true

**Explanation:** Results default to classic Kyverno policies, which also need a rule name. For the newer policy types you set a flag such as isValidatingPolicy, isMutatingPolicy or isImageValidatingPolicy. The kind field in a result is the kind of the tested resource, such as Deployment, not the policy type.

### The Kyverno 1.20 Helm chart refuses to upgrade because legacy kyverno.io policies exist. Which value lets the upgrade proceed?

Kyverno, Medium (Advanced), Installation. https://k8wiz.com/uquiz/the-kyverno-120-helm-chart-refuses-to-upgrade-because-legacy-kyvernoio-policies-exist-which-value-lets-the-upgrade-proceed

- A. upgrade.allowLegacyPolicies=true
- B. upgrade.fromV2=true
- C. upgrade.acknowledgeLegacyPoliciesNotEnforced=true
- D. upgrade.legacyPolicyCheck.enabled=false

**Answer:** upgrade.acknowledgeLegacyPoliciesNotEnforced=true

**Explanation:** upgrade.acknowledgeLegacyPoliciesNotEnforced=true disables both the render-time lookup check and the pre-upgrade hook Job. It does not keep the legacy policies running. upgrade.legacyPolicyCheck.enabled=false only disables the hook Job, so the render-time check still blocks, and a stale upgrade.allowLegacyPolicies: true from an older values file makes the render fail.

### A GeneratingPolicy that clones a Secret into new namespaces fails with a forbidden error. Which label on a ClusterRole merges its rules into the Kyverno background controller's permissions?

Kyverno, Medium (Advanced), Security. https://k8wiz.com/uquiz/a-generatingpolicy-that-clones-a-secret-into-new-namespaces-fails-with-a-forbidden-error-which-label-on-a-clusterrole-merges-its

- A. rbac.kyverno.io/aggregate-to-admission-controller: "true"
- B. rbac.authorization.k8s.io/aggregate-to-background-controller: "true"
- C. kyverno.io/aggregate-to-background-controller: "true"
- D. rbac.kyverno.io/aggregate-to-background-controller: "true"

**Answer:** rbac.kyverno.io/aggregate-to-background-controller: "true"

**Explanation:** The background controller creates generated resources, and its ClusterRole has an aggregation rule that selects ClusterRoles labeled rbac.kyverno.io/aggregate-to-background-controller: "true". The default Helm install lets it write NetworkPolicies, ConfigMaps, quotas, LimitRanges, Roles and RoleBindings, but not Secrets in other namespaces, so cloning Secrets needs this extra ClusterRole.

### A Kyverno MutatingPolicy ApplyConfiguration can't set a container's args because the list is atomic. Which setting allows the change?

Kyverno, Medium (Advanced), Mutation. https://k8wiz.com/uquiz/a-kyverno-mutatingpolicy-applyconfiguration-cant-set-a-containers-args-because-the-list-is-atomic-which-setting-allows-the-chang

- A. reinvocationPolicy: IfNeeded
- B. evaluation.mode: JSON
- C. evaluation.useServerSideApply: true
- D. evaluation.mutateExisting.enabled: true

**Answer:** evaluation.useServerSideApply: true

**Explanation:** By default an apply configuration may not modify atomic structs, maps or lists, matching native MutatingAdmissionPolicy behavior. useServerSideApply: true applies the patch with server-side apply semantics, which replaces the atomic value as a whole, so anything the author had in that list is dropped. JSON mode rejects ApplyConfiguration patches entirely.

## Expert (Hard): 24 questions

Interactive quiz: https://k8wiz.com/kyverno/quiz/hard

### What is the purpose of the 'context' field in a Kyverno policy?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-context-field-in-a-kyverno-policy

- A. To provide additional information about the policy
- B. To define variables that can be used in the policy rules
- C. To specify the context in which the policy should be applied
- D. To add contextual documentation to the policy

**Answer:** To define variables that can be used in the policy rules

**Explanation:** The 'context' field in a Kyverno policy is used to define variables that can be used in the policy rules. These variables can be populated from various sources like ConfigMaps, API calls, or other resources.

### What is the purpose of the 'foreach' field in a Kyverno rule?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-foreach-field-in-a-kyverno-rule

- A. To iterate over a list of resources
- B. To apply the rule to each item in a list or map within a resource
- C. To apply the rule to each namespace in the cluster
- D. To iterate over each policy in the cluster

**Answer:** To apply the rule to each item in a list or map within a resource

**Explanation:** The 'foreach' field in a Kyverno rule is used to apply the rule to each item in a list or map within a resource. This is useful for validating or mutating arrays of objects, such as containers in a pod specification.

### Which of the following is NOT a component of the Kyverno architecture?

Kyverno, Hard (Expert), Architecture. https://k8wiz.com/uquiz/which-of-the-following-is-not-a-component-of-the-kyverno-architecture

- A. Admission Controller
- B. Background Controller
- C. Policy Controller
- D. Resource Controller

**Answer:** Resource Controller

**Explanation:** The main components of Kyverno architecture include the Admission Controller (for validating and mutating resources at creation/update time), the Background Controller (for applying policies to existing resources), and the Report Controller (for generating reports). There is no 'Resource Controller' in Kyverno's architecture.

### What is the purpose of the 'kyverno.io/updateToken' annotation in a generated resource?

Kyverno, Hard (Expert), Generation. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-kyvernoioupdatetoken-annotation-in-a-generated-resource

- A. To authenticate updates to the resource
- B. To track when the resource was last updated
- C. To control when the resource should be updated by Kyverno
- D. To identify which version of Kyverno generated the resource

**Answer:** To control when the resource should be updated by Kyverno

**Explanation:** The 'kyverno.io/updateToken' annotation in a generated resource is used by Kyverno to determine when the resource should be updated. If the token changes, Kyverno will update the generated resource.

### Which of the following is NOT a valid source for context variables in Kyverno?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-not-a-valid-source-for-context-variables-in-kyverno

- A. ConfigMap
- B. APICall
- C. ImageRegistry
- D. Secret

**Answer:** Secret

**Explanation:** Kyverno context variables can be sourced from ConfigMap, APICall, and ImageRegistry, but not directly from Secrets for security reasons. Secrets contain sensitive data and should not be used directly in policies.

### What is the purpose of the 'kyverno.io/last-applied-policy' annotation?

Kyverno, Hard (Expert), Mutation. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-kyvernoiolast-applied-policy-annotation

- A. To track which policy was last applied to a resource
- B. To store the last version of a policy that was applied
- C. To store the last state of a resource before a policy was applied
- D. To indicate when a policy was last applied to a resource

**Answer:** To store the last state of a resource before a policy was applied

**Explanation:** The 'kyverno.io/last-applied-policy' annotation is used to store the last state of a resource before a policy was applied. This is used for tracking changes made by policies and for potential rollback.

### Which of the following is a valid way to define a variable in a Kyverno policy?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/which-of-the-following-is-a-valid-way-to-define-a-variable-in-a-kyverno-policy

- A. variables: { var1: value1 }
- B. context: [ { name: var1, value: value1 } ]
- C. context: [ { name: var1, configMap: { name: cm1, namespace: default } } ]
- D. define: { var1: value1 }

**Answer:** context: [ { name: var1, configMap: { name: cm1, namespace: default } } ]

**Explanation:** In Kyverno policies, variables are defined in the 'context' section. The syntax 'context: [ { name: var1, configMap: { name: cm1, namespace: default } } ]' defines a variable named 'var1' with a value from a ConfigMap named 'cm1' in the 'default' namespace.

### What is the purpose of the 'kyverno.io/policy-update-mode' annotation?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/what-is-the-purpose-of-the-kyvernoiopolicy-update-mode-annotation

- A. To control how policies are updated
- B. To control how resources are updated when policies change
- C. To control how Kyverno itself is updated
- D. To control how policy reports are updated

**Answer:** To control how resources are updated when policies change

**Explanation:** The 'kyverno.io/policy-update-mode' annotation is used to control how resources are updated when policies change. It can be set to values like 'enforce' or 'audit' to determine the behavior when a policy is updated.

### All Kyverno admission controller pods are down, and a policy's webhook failurePolicy is Fail. What happens to API requests that its webhook matches?

Kyverno, Hard (Expert), Architecture. https://k8wiz.com/uquiz/all-kyverno-admission-controller-pods-are-down-and-a-policys-webhook-failurepolicy-is-fail-what-happens-to-api-requests-that-its

- A. They are allowed and checked later by a background scan
- B. They are queued until Kyverno comes back
- C. The API server skips Kyverno and evaluates the policy itself
- D. They are rejected until Kyverno is available again

**Answer:** They are rejected until Kyverno is available again

**Explanation:** Fail is the default. If the API server can't reach the webhook, it rejects the request, which can block deployments across the cluster. Run several admission controller replicas, keep critical namespaces out of scope, or use Ignore for policies where availability matters more than enforcement. The setting lives in spec.webhookConfiguration.failurePolicy; the old spec.failurePolicy field is deprecated.

### How does Kyverno change resources that already exist in the cluster, rather than only new admission requests?

Kyverno, Hard (Expert), Mutation. https://k8wiz.com/uquiz/how-does-kyverno-change-resources-that-already-exist-in-the-cluster-rather-than-only-new-admission-requests

- A. A validate rule in Audit mode that rewrites failing resources
- B. A generate rule with synchronize: true pointing at the resources
- C. Running 'kyverno apply --mutate' against the live cluster
- D. A mutate rule with 'targets', run by the background controller

**Answer:** A mutate rule with 'targets', run by the background controller

**Explanation:** Mutate-existing rules name the resources to change under 'targets'. A trigger event, or a policy event when mutateExistingOnPolicyUpdate is set on the rule, makes the background controller patch those targets. Kyverno needs RBAC permission to update those kinds, granted to the background controller's service account.

### A new generate rule creates a NetworkPolicy in every Namespace. What makes Kyverno also create it in Namespaces that existed before the policy?

Kyverno, Hard (Expert), Generation. https://k8wiz.com/uquiz/a-new-generate-rule-creates-a-networkpolicy-in-every-namespace-what-makes-kyverno-also-create-it-in-namespaces-that-existed-befo

- A. Setting background: false on the policy
- B. Setting synchronize: true
- C. Running 'kubectl rollout restart' on the namespaces
- D. Setting generateExisting: true on the generate rule

**Answer:** Setting generateExisting: true on the generate rule

**Explanation:** A generate rule normally fires on admission events, so Namespaces that already exist are skipped. With generateExisting: true, the background controller also processes the matching resources that exist when the policy is created. The field belongs under the rule's generate section; the spec-level version is deprecated. synchronize only controls whether Kyverno keeps generated resources in sync afterwards.

### Which label makes Kyverno delete a resource automatically after a set amount of time?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/which-label-makes-kyverno-delete-a-resource-automatically-after-a-set-amount-of-time

- A. kyverno.io/expire-after
- B. cleanup.kyverno.io/ttl
- C. kubernetes.io/ttl
- D. policies.kyverno.io/delete-at

**Answer:** cleanup.kyverno.io/ttl

**Explanation:** Kyverno's cleanup controller watches resources with this label and deletes them when the time runs out, for example cleanup.kyverno.io/ttl: 2h. The controller needs RBAC permission to delete that kind. For rule-based deletion on a schedule, use a CleanupPolicy or ClusterCleanupPolicy instead.

### A Kyverno verifyImages rule has mutateDigest: true. What does it do once the signature is verified?

Kyverno, Hard (Expert), Security. https://k8wiz.com/uquiz/a-kyverno-verifyimages-rule-has-mutatedigest-true-what-does-it-do-once-the-signature-is-verified

- A. Uploads the verified signature to the image registry
- B. Rejects images that are referenced by digest instead of tag
- C. Replaces the image tag in the pod spec with the verified digest
- D. Recomputes the digest and stores it in an annotation

**Answer:** Replaces the image tag in the pod spec with the verified digest

**Explanation:** A tag can be moved to point at a different image after verification. mutateDigest pins the pod to the exact digest Kyverno checked, so the node pulls the image that was verified. It is enabled by default.

### In a Kyverno mutate overlay (patchStrategicMerge), what does the +() anchor do, as in '+(imagePullPolicy): IfNotPresent'?

Kyverno, Hard (Expert), Mutation. https://k8wiz.com/uquiz/in-a-kyverno-mutate-overlay-patchstrategicmerge-what-does-the-anchor-do-as-in-imagepullpolicy-ifnotpresent

- A. Always overwrites the field
- B. Adds the field only if it isn't already set
- C. Removes the field if it is present
- D. Appends the value to a list field

**Answer:** Adds the field only if it isn't already set

**Explanation:** +() is the add-if-not-present anchor. In this example Kyverno sets imagePullPolicy only on containers that don't define one and leaves existing values alone. Without the anchor, the overlay overwrites the field every time.

### In a Kyverno validate pattern, what does the X() negation anchor mean, as in 'X(hostPath): "null"'?

Kyverno, Hard (Expert), Validation. https://k8wiz.com/uquiz/in-a-kyverno-validate-pattern-what-does-the-x-negation-anchor-mean-as-in-xhostpath-null

- A. The field must not be present
- B. The field must equal the string X
- C. The field is optional
- D. Validation is skipped if the field exists

**Answer:** The field must not be present

**Explanation:** X() fails validation when the tagged field exists, whatever its value, so X(hostPath) under volumes rejects any hostPath volume. The value after it is ignored, and "null" is the convention. Other anchors include () for conditions, ^() for existence in lists, and =() for checking a field only when it's present.

### Which Kyverno resource exempts specific resources from a policy rule without editing the policy?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/which-kyverno-resource-exempts-specific-resources-from-a-policy-rule-without-editing-the-policy

- A. ClusterPolicyReport
- B. CleanupPolicy
- C. PolicyException
- D. UpdateRequest

**Answer:** PolicyException

**Explanation:** A PolicyException names the policies and rules it applies to and matches the resources to exempt, so teams can get exceptions without touching shared policies. Because exceptions weaken enforcement, Kyverno lets you restrict which namespaces may hold them, and you should limit who can create them with RBAC.

### What does the 'kyverno test' command read to run policy tests?

Kyverno, Hard (Expert), Testing. https://k8wiz.com/uquiz/what-does-the-kyverno-test-command-read-to-run-policy-tests

- A. kyverno-test.yaml files listing policies, resources and expected results
- B. Go test files (*_test.go) placed next to the policy YAML
- C. PolicyReports fetched from the cluster in the current context
- D. The templates/tests/ directory of a Helm chart that holds the policies

**Answer:** kyverno-test.yaml files listing policies, resources and expected results

**Explanation:** 'kyverno test <dir>' finds kyverno-test.yaml files, applies the listed policies to the listed resources without a cluster, and compares each rule's result (pass, fail or skip) with the expected one. Running it in CI catches policy regressions before they reach a cluster.

### Why must background be set to false on a Kyverno policy whose rules use request.userInfo, such as the requesting user's name or roles?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/why-must-background-be-set-to-false-on-a-kyverno-policy-whose-rules-use-requestuserinfo-such-as-the-requesting-users-name-or-rol

- A. Background scans run without an admission request, so there's no user
- B. request.userInfo is only populated for mutate rules, not validate rules
- C. Background scans run as cluster-admin, so userInfo checks always pass
- D. request.userInfo was deprecated and only works with background off

**Answer:** Background scans run without an admission request, so there's no user

**Explanation:** Background scans check resources already stored in the cluster, outside any admission request, so there's no requesting user, group or role. Kyverno requires background: false for rules that use variables only an admission request provides, and those rules then run only at admission time.

### In recent Kyverno versions, where should you set Enforce or Audit for a validate rule?

Kyverno, Hard (Expert), Validation. https://k8wiz.com/uquiz/in-recent-kyverno-versions-where-should-you-set-enforce-or-audit-for-a-validate-rule

- A. In the kyverno ConfigMap, under an enforcement key
- B. In validate.failureAction on each rule
- C. With a kyverno.io/mode annotation on the policy
- D. Only in spec.validationFailureAction at the policy level

**Answer:** In validate.failureAction on each rule

**Explanation:** Setting the action per rule lets one policy mix enforced and audited rules. Policies that still set spec.validationFailureAction keep working, but the field is deprecated, so new policies should use validate.failureAction.

### Kyverno 1.16 ships CEL-based policy types at API version v1beta1. Which one validates resources with CEL expressions, in the style of Kubernetes ValidatingAdmissionPolicy?

Kyverno, Hard (Expert), Validation. https://k8wiz.com/uquiz/kyverno-116-ships-cel-based-policy-types-at-api-version-v1beta1-which-one-validates-resources-with-cel-expressions-in-the-style

- A. ClusterPolicy with a validate.pattern
- B. CleanupPolicy
- C. ValidatingPolicy
- D. PolicyException

**Answer:** ValidatingPolicy

**Explanation:** ValidatingPolicy expresses rules as CEL expressions, like Kubernetes ValidatingAdmissionPolicy, and adds Kyverno features such as background scans and policy reports. The same family includes MutatingPolicy, GeneratingPolicy, DeletingPolicy and ImageValidatingPolicy, plus namespaced versions of some of them. Existing ClusterPolicy resources keep working.

### A CI job runs kyverno test policies/ but a directory rename means no kyverno-test.yaml files are found. Which flag makes the job fail instead of passing?

Kyverno, Hard (Expert), Testing. https://k8wiz.com/uquiz/a-ci-job-runs-kyverno-test-policies-but-a-directory-rename-means-no-kyverno-testyaml-files-are-found-which-flag-makes-the-job-fa

- A. --require-tests
- B. --fail-only
- C. --warnings-as-errors
- D. --detailed-results

**Answer:** --require-tests

**Explanation:** When no test files are found, kyverno test prints "No test yamls available" and still exits successfully, so the CI job passes without testing anything. --require-tests turns that case into an error. --fail-only only limits the output to failing tests.

### After an upgrade to Kyverno 1.20, Argo CD reports a legacy ClusterPolicy as out of sync on every reconcile, though its manifest never changed. Why?

Kyverno, Hard (Expert), Policies. https://k8wiz.com/uquiz/after-an-upgrade-to-kyverno-120-argo-cd-reports-a-legacy-clusterpolicy-as-out-of-sync-on-every-reconcile-though-its-manifest-nev

- A. Kyverno marks the policy NotReady, which Argo CD reports as drift
- B. Kyverno denies updates to legacy policy kinds, even an unchanged re-apply
- C. Helm pruned the legacy CRD, so the apply targets a missing kind
- D. Kyverno rewrites the stored object to the policies.kyverno.io group

**Answer:** Kyverno denies updates to legacy policy kinds, even an unchanged re-apply

**Explanation:** In 1.20 Kyverno denies every create and almost every update to the five legacy policy kinds, including a re-apply of an unchanged manifest, which 1.19 silently accepted. Each reconcile is rejected, so the app never syncs. The legacy CRDs carry helm.sh/resource-policy: keep and are not pruned; the fix is to migrate the policy and remove the legacy manifest from Git.

### A GeneratingPolicy with synchronize enabled defines its resources inline. What does setting evaluation.orphanDownstreamOnPolicyDelete.enabled to true change?

Kyverno, Hard (Expert), Generation. https://k8wiz.com/uquiz/a-generatingpolicy-with-synchronize-enabled-defines-its-resources-inline-what-does-setting-evaluationorphandownstreamonpolicydel

- A. Generated resources are deleted as soon as their trigger changes
- B. Generated resources stay in the cluster when the policy is deleted
- C. Generated resources are no longer reverted after manual edits
- D. Generated resources are created only in namespaces that already exist

**Answer:** Generated resources stay in the cluster when the policy is deleted

**Explanation:** With synchronization on, deleting a data-source GeneratingPolicy also deletes everything it generated, because orphanDownstreamOnPolicyDelete defaults to false. Setting it to true keeps (orphans) those resources after the policy is gone. It has no effect on reverting edits, which synchronization still handles, or on existing namespaces, which is generateExisting's job.

### A Kyverno MutatingPolicy matches Pods, keeps the default autogen settings and uses a JSONPatch on /metadata/annotations. What happens in its Deployment variant?

Kyverno, Hard (Expert), Mutation. https://k8wiz.com/uquiz/a-kyverno-mutatingpolicy-matches-pods-keeps-the-default-autogen-settings-and-uses-a-jsonpatch-on-metadataannotations-what-happen

- A. Kyverno rewrites the path to /spec/template/metadata/annotations
- B. The path is copied unchanged, so it patches the Deployment itself
- C. Kyverno rejects the policy because JSONPatch can't be autogenerated
- D. The mutation is dropped and only ApplyConfiguration ones are kept

**Answer:** The path is copied unchanged, so it patches the Deployment itself

**Explanation:** Autogen rewrites object.spec and metadata label and annotation references in matchConditions and ApplyConfiguration expressions so they point at the Pod template. JSONPatch expressions are copied as written, so their paths still target the top-level object. Keep JSONPatch Pod mutations in a policy with autogen.podControllers.enabled set to false, or use ApplyConfiguration.
