I have a docker image I deployed onto OpenShift (using oc new-app). However, it's not working properly because of a missing dns search entry in /etc/resolv.conf. When I create a container from my docker image and run it, I can specify the parmater --dns-search.
How can I do something similar during the deployment of my image onto OpenShift with oc new-app?
You can edit the config Map of Node in master server
# oc get cm -n openshift-node
for all compute nodes edit the config map by below command.( Only need to perform in master server)
# oc edit cm node-config-compute -n openshift-node
......
dnsBindAddress: 127.0.0.1:53
dnsDomain: cluster.local
dnsIP: 10.0.80.11
dnsNameservers: null
dnsRecursiveResolvConf: /etc/origin/node/resolv.conf
.......
Edit dnsIP section with your DNS IP. Then restart the service
# systemctl restart atomic-openshift-node.service
The DNS ip will be prepended in all /etc/resolv.conf file of Pods.
Detail Information is present here
There are a few options:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.