I'm trying to override dnsconfig (searchdomain particularly) of my alpine based pod.
But it seems dnsconfig is available in pod object.
Is there anyway to provide dnsconfig in deployment object or any other workaround to override searchdomain of that particular pod.
You can specify the dnsConfig
inside spec.template
object.
This is basically a template for your Deployment
which will be used to create pods.
Deployment might look like the following:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.17
ports:
- containerPort: 80
dnsPolicy: "None"
dnsConfig:
nameservers:
- 1.2.3.4
searches:
- test.test.com
- test.test.org