Filter

Add ndots

The ndots value controls where DNS lookups are first performed in a cluster and needs to be set to a lower value than the default of 5 in some cases. This policy mutates all Pods to add the ndots option with a value of 1.

Policy Definition

/other/add_ndots.yaml

 1apiVersion: kyverno.io/v1
 2kind: ClusterPolicy
 3metadata:
 4  name: add-ndots
 5  annotations:
 6    policies.kyverno.io/title: Add ndots
 7    policies.kyverno.io/category: Sample
 8    policies.kyverno.io/subject: Pod
 9    policies.kyverno.io/description: >-
10      The ndots value controls where DNS lookups are first performed in a cluster
11      and needs to be set to a lower value than the default of 5 in some cases.
12      This policy mutates all Pods to add the ndots option with a value of 1.      
13spec:
14  background: false
15  rules:
16  - name: add-ndots
17    match:
18      resources:
19        kinds:
20        - Pod
21    mutate:
22      patchStrategicMerge:
23        spec:
24          dnsConfig:
25            options:
26              - name: ndots
27                value: "1"