How Do I Configure the DNS Service on CCI?
If workloads require the internal domain name resolution provided by Kubernetes, the coredns add-on must be installed. In this case, dnsPolicy of pods must be set to ClusterFirst.
On the Add-on Marketplace page, click
on the card of the coredns add-on to install it under the specified namespace.
If workloads do not require the internal domain name resolution provided by Kubernetes but require HUAWEI CLOUD DNS, dnsPolicy of pods must be set to Default.
In addition, you can set dnsPolicy of pods to None to use the custom DNS service. The following is a YAML example:
apiVersion: v1
kind: Pod
metadata:
namespace: default
name: dns-example
spec:
containers:
- name: test
image: nginx
dnsPolicy: "None"
dnsConfig:
nameservers:
- 1.2.3.4
searches:
- ns1.svc.cluster-domain.example
- my.dns.search.suffix
options:
- name: ndots
value: "2"
- name: edns0
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.