blob: 3a1883b3a3a267420a754747b4ff50f46caae0b9 [file] [log] [blame]
Mohammed Naser9ad0d462023-01-15 20:36:37 -05001{{- if .Values.isClusterService }}
2CoreDNS is now running in the cluster as a cluster-service.
3{{- else }}
4CoreDNS is now running in the cluster.
5It can be accessed using the below endpoint
6{{- if contains "NodePort" .Values.serviceType }}
7 export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "coredns.fullname" . }})
8 export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
9 echo "$NODE_IP:$NODE_PORT"
10{{- else if contains "LoadBalancer" .Values.serviceType }}
11 NOTE: It may take a few minutes for the LoadBalancer IP to be available.
12 You can watch the status by running 'kubectl get svc -w {{ template "coredns.fullname" . }}'
13
14 export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "coredns.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
15 echo $SERVICE_IP
16{{- else if contains "ClusterIP" .Values.serviceType }}
17 "{{ template "coredns.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
18 from within the cluster
19{{- end }}
20{{- end }}
21
22It can be tested with the following:
23
241. Launch a Pod with DNS tools:
25
26kubectl run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools
27
282. Query the DNS server:
29
30/ # host kubernetes