Setup required to test DnsSwitch functionality
These steps are used to test DNSSwitch functionality within PROM POD
1. Place dnsSwitch.bash on core-dns master under /home/ubuntu
2.Following are the steps to create ssh key for remote core-dns connection
Code Block |
---|
a. ExecuteAs a root user, execute below command /home/ubuntu on coredns master (make sure to use the key name as coredns.key) : $ ssh-keygen -t rsa -f coredns.key (hit Enter key for the prompts) - This creates two files-: coredns.key and coredns.key.pub under /home/ubuntu b. verify below command works for root user without any prompts(because the key was added with root user): ssh -i /home/ubuntu/coredns.key root@<corednsHost> c. Copy coredns.key and coredns.key.pub files underto /dockerdata-nfs/coredns on Master Sites ubuntu@k8s-master:/dockerdata-nfs/coredns$ ls -l total 8 -rw------- 1 root root 1675 May 3 14:57 coredns.key -rw-r--r-- 1 root root 394 May 3 14:57 coredns.key.pub all Master sites |
3. Make sure kubectl works on core-dns master
Code Block |
---|
#kubernetes cluster was installed using ubuntu, hence below does not work root@core-dns-master:/home/ubuntu# kubectl get pods -n onap The connection to the server localhost:8080 was refused - did you specify the right host or port? #copy kube config using root user to /root to make it work root@core-dns-master:/home/ubuntu# cp /home/ubuntu/.kube/ /root #verify kubectl works from root user root@core-dns-master:~# kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-7fd6694686-dnwt7 1/1 Running 2 11d kube-system coredns-7fd6694686-jrj92 1/1 Running 2 11d kube-system etcd-core-dns-master 1/1 Running 2 12d kube-system kube-apiserver-core-dns-master 1/1 Running 10 12d kube-system kube-controller-manager-core-dns-master 1/1 Running 8 12d kube-system kube-proxy-j4wlv 1/1 Running 2 12d kube-system kube-proxy-q74fc 1/1 Running 2 12d kube-system kube-scheduler-core-dns-master 1/1 Running 7 12d kube-system tiller-deploy-84f4c8bb78-skvlp 1/1 Running 2 12d kube-system weave-net-lq4ls 2/2 Running 7 12d kube-system weave-net-rm6z4 2/2 Running 15 12d |
6. Execute sdnc.makeActive script from Site A or Site B to trigger manual failover and DNSSwitch
Code Block |
---|
root@k8s-master:/home/ubuntu# ./sdnc.makeActive |
7. You may verify the logs on core-dns master :
Code Block |
---|
root@core-dns-master:~$ ll *.log -rw-r--r-- 1 root root 12002 May 1 11:28 dnsSwitch.log root@core-dns-master:~$ root@core-dns-master:~$ cat dnsSwitch.log Fri Apr 27 09:16:10 EDT 2018 script called from site: 10.147.113.136 Fri Apr 27 09:16:10 EDT 2018 logging current dns entry Server: 10.96.0.10 Address: 10.96.0.10#53 Name: sdnc.example.com Address: 10.147.112.139 Fri Apr 27 09:16:10 EDT 2018 editing dns zone Fri Apr 27 09:16:10 EDT 2018 verify if dns domain address exist in configuration for given app: sdnc Fri Apr 27 09:16:10 EDT 2018 dns domain address was found Fri Apr 27 09:16:10 EDT 2018 dns zone file edited Fri Apr 27 09:16:10 EDT 2018 editing coredns configmap configmap "coredns" deleted configmap "coredns" created Fri Apr 27 09:16:11 EDT 2018 coredns configmap edited Fri Apr 27 09:16:11 EDT 2018 waiting for dns cache time Fri Apr 27 09:17:01 EDT 2018 sending refresh signal for coredns configmap Fri Apr 27 09:17:01 EDT 2018 Completed executing sdnc.dnsswitch on host: core-dns-master |