Kyverno
Hard
Policies
Which of the following is a valid way to define a variable in a Kyverno policy?
Select your answer:
Show answer and explanation
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.
More hard Kyverno questions
- 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?