Important
Notice: Starting from Kubewarden release 1.32.0, all code from this repository has been merged into github.com/kubewarden/policies, which is now a monorepo containing policies. Please refer to that repository for future updates and development. This repository is now archived. Development continues in the new location.
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: 2When 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: nginxTo the following Pod:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
dnsConfig:
options:
- name: ndots
value: "1"
containers:
- name: nginx
image: nginx