Kubewarden policy that enforces the DNS lookup configuration of a Pod to have a specific ndots
value.
This is done by mutating the Pod's .spec.dnsConfig.options
field to have the desired ndots
value.
The number of ndots
to enforce can be configured using the ndots
field.
ndots: 2
When no configuration is provided, the default value is 1
.
Assuming the no configuration is provided, the policy will enforce the ndots
value to be 1
.
This will change the following Pod:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
To the following Pod:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
dnsConfig:
options:
- name: ndots
value: "1"
containers:
- name: nginx
image: nginx