Kyverno Quiz
Select your difficulty level to begin the quiz
Free Kyverno quiz with 70 multiple-choice questions on policy as code with validate, mutate, generate, verifyImages and cleanup rules, at beginner, advanced and expert level. Every answer comes with an explanation.
Latest Kyverno Articles
Set Pod defaults with a Kyverno MutatingPolicy
Cosign explained: sign and verify container images, step by step
Create namespace defaults with a Kyverno GeneratingPolicy
Kyverno 1.20: legacy ClusterPolicy is no longer enforced, how to upgrade
How to test Kyverno policies in CI with the Kyverno CLI
Kyverno 1.16: Revolutionizing Kubernetes Policy as Code
Kyverno graphs
All Kyverno questions
Each question has its own page with the answer and an explanation.
Beginner: 24 easy questions
- What is Kyverno?
- Which Kubernetes resource type does Kyverno use to define policies?
- What are the three main types of rules in Kyverno policies?
- Which command is used to install Kyverno in a Kubernetes cluster?
- What is the purpose of a validation rule in Kyverno?
- What is the purpose of a mutation rule in Kyverno?
- Which command is used to test a Kyverno policy against a resource without applying it to the cluster?
- Which Kubernetes API group does Kyverno use for its resources?
- What is the difference between a ClusterPolicy and a Policy in Kyverno?
- Which of the following is NOT a valid rule type in a Kyverno policy?
- Which command is used to generate a policy from a resource?
- Which command is used to check if Kyverno is ready in a Kubernetes cluster?
- Which apiVersion does a Kyverno CLI kyverno-test.yaml file use?
- What does kyverno test do when an actual policy result doesn't match the expected one?
- In a kyverno-test.yaml file, which expected result do you write for a resource the policy should block?
- What happens to an existing ClusterPolicy when a cluster is upgraded to Kyverno 1.20?
- Which validationActions value makes a Kyverno ValidatingPolicy reject a request that fails a validation?
- When you migrate a ClusterPolicy to the CEL-based types, which kind replaces a generate rule?
- Which CEL function does a Kyverno GeneratingPolicy call in a generate expression to create resources in a namespace?
- A GeneratingPolicy defines a NetworkPolicy inline and has evaluation.synchronize.enabled set to true. What happens when someone deletes the generated NetworkPolicy?
- In a Kyverno GeneratingPolicy template entry, which interpolate value makes Kyverno evaluate (( ... )) placeholders in the YAML?
- Which two patchType values does a mutation in a Kyverno MutatingPolicy accept?
- Which Kyverno kind lets a namespace owner write mutation rules that apply only to resources in that namespace?
- In a Kyverno MutatingPolicy, which field turns on mutation of resources that already exist in the cluster?
Advanced: 22 medium questions
- 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?
- What is the purpose of the 'validationFailureAction' field in a Kyverno policy?
- Which of the following is a valid JMESPath expression in a Kyverno policy?
- What is the purpose of the 'exclude' field in a Kyverno policy?
- What is the purpose of the 'preconditions' field in a Kyverno rule?
- Which of the following is a valid pattern matching syntax in Kyverno?
- What is the purpose of the 'audit' value for 'validationFailureAction' in a Kyverno policy?
- What is the purpose of the 'synchronize' field in a Kyverno generate rule?
- Which of the following is NOT a valid operation in a Kyverno mutate rule?
- What is the purpose of the 'policyReport' resource in Kyverno?
- Which of the following is a valid way to exclude system namespaces in a Kyverno policy?
- What is the purpose of the 'match.resources.selector' field in a Kyverno policy?
- What is the purpose of the 'kyverno.io/ignore' annotation?
- Which of the following is a valid way to use a variable in a Kyverno policy pattern?
- What is the purpose of the 'kyverno.io/generated-by' annotation?
- In a kyverno-test.yaml results entry, which field marks the result as coming from a CEL-based ValidatingPolicy?
- The Kyverno 1.20 Helm chart refuses to upgrade because legacy kyverno.io policies exist. Which value lets the upgrade proceed?
- 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?
- A Kyverno MutatingPolicy ApplyConfiguration can't set a container's args because the list is atomic. Which setting allows the change?
Expert: 24 hard questions
- What is the purpose of the 'context' field in a Kyverno policy?
- What is the purpose of the 'foreach' field in a Kyverno rule?
- Which of the following is NOT a component of the Kyverno architecture?
- What is the purpose of the 'kyverno.io/updateToken' annotation in a generated resource?
- Which of the following is NOT a valid source for context variables in Kyverno?
- What is the purpose of the 'kyverno.io/last-applied-policy' annotation?
- Which of the following is a valid way to define a variable in a Kyverno policy?
- What is the purpose of the 'kyverno.io/policy-update-mode' annotation?
- All Kyverno admission controller pods are down, and a policy's webhook failurePolicy is Fail. What happens to API requests that its webhook matches?
- How does Kyverno change resources that already exist in the cluster, rather than only new admission requests?
- A new generate rule creates a NetworkPolicy in every Namespace. What makes Kyverno also create it in Namespaces that existed before the policy?
- Which label makes Kyverno delete a resource automatically after a set amount of time?
- A Kyverno verifyImages rule has mutateDigest: true. What does it do once the signature is verified?
- In a Kyverno mutate overlay (patchStrategicMerge), what does the +() anchor do, as in '+(imagePullPolicy): IfNotPresent'?
- In a Kyverno validate pattern, what does the X() negation anchor mean, as in 'X(hostPath): "null"'?
- Which Kyverno resource exempts specific resources from a policy rule without editing the policy?
- What does the 'kyverno test' command read to run policy tests?
- 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?
- In recent Kyverno versions, where should you set Enforce or Audit for a validate rule?
- 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?
- 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?
- 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?
- A GeneratingPolicy with synchronize enabled defines its resources inline. What does setting evaluation.orphanDownstreamOnPolicyDelete.enabled to true change?
- A Kyverno MutatingPolicy matches Pods, keeps the default autogen settings and uses a JSONPatch on /metadata/annotations. What happens in its Deployment variant?