Skip to content

Latest commit

 

History

History
 
 

Alpine requests for CoreDNS service

This example demonstrates how an external client configures DNS from the connected endpoint. Note: NSE provides DNS by itself. Also, NSE could provide configs for any other external DNS servers(that are not located as sidecar with NSE).

Requires

Make sure that you have completed steps from features

Run

Create test namespace:

kubectl create ns ns-dns

Deploy alpine and nse

kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/dns?ref=58a90eb58a3e06f02cbd99c221b35327488025cc

Wait for applications ready:

kubectl wait --for=condition=ready --timeout=5m pod dnsutils -n ns-dns
kubectl wait --for=condition=ready --timeout=5m pod -l app=nse-kernel -n ns-dns

Find NSC and NSE pods by labels:

NSC=$(kubectl get pods -l app=dnsutils -n ns-dns --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
NSE=$(kubectl get pods -l app=nse-kernel -n ns-dns --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')

Ping from dnsutils to NSE by domain name:

kubectl exec ${NSC} -c dnsutils -n ns-dns -- nslookup -norec -nodef my.coredns.service
kubectl exec ${NSC} -c dnsutils -n ns-dns -- ping -c 4 my.coredns.service

Validate that default DNS server is working:

kubectl exec ${NSC} -c dnsutils -n ns-dns -- nslookup kubernetes.default

Cleanup

Delete ns:

kubectl delete ns ns-dns