Creation of kubernetes kube-dns service
Here this file is edited to set the value of the clutserIP for the DNS service.
clusterIP: 100.65.0.10
kubectl create -f kube-dns.yaml
service "kube-dns" created
serviceaccount "kube-dns" created
configmap "kube-dns" created
deployment.extensions "kube-dns" created
Testing if kube-dns service is working properly
Please note that as JQ command is used, in the minimal install of CentOS7 JQ is not there. Also this is available from the EPEL repo for CentOS.
Installation of JQ
yum -y install epel-release
yum clean all
rm -rf /var/cache/yum
yum -y install jq
yum -y remove epel-release
yum clean all
rm -rf /var/cahce/yum
Creation of a BusyBox deployment to test the DNS
kubectl run busybox --image=busybox --command -- sleep 3600
kubectl get pods -l run=busybox
POD_NAME=$(kubectl get pods -l run=busybox -o json | jq .items[0].metadata.name| tr -d \")
echo $POD_NAME
kubectl exec -ti $POD_NAME -- nslookup kubernetes
You can see that the service names are getting resolved here.
Server: 100.65.0.10
Address 1: 100.65.0.10 kube-dns.kube-system.svc.cluster.local
Name: kubernetes
Address 1: 100.65.0.1 kubernetes.default.svc.cluster.local
Resolving external names
[root@kuben1 ~]# kubectl exec -ti $POD_NAME -- nslookup google.com
Server: 100.65.0.10
Address 1: 100.65.0.10 kube-dns.kube-system.svc.cluster.local
Name: google.com
Address 1: 2404:6800:4005:808::200e hkg12s13-in-x0e.1e100.net
Address 2: 216.58.203.46 hkg12s10-in-f46.1e100.net
[root@kuben1 ~]#
Other relevant links for this documentation.
You can click on any of the link to view them.
The Main Document - Kubernetes 1.10.0 with 3 Master and Slave nodes and SSL on CentOS7
KVM Host and Guest Preprations
SSL Certificate Generations
Configure simple external HAPROXY
Configuring ETCD with SSL on the Master servers
Creation of the POD Network information in ETCD for flanneld
Install and Configure the Master Service on the Kubernetes Master servers
Installation and Configuration of the Kubernetes Slaves
Installation and testing of kube-dns
You can click on any of the link to view them.
The Main Document - Kubernetes 1.10.0 with 3 Master and Slave nodes and SSL on CentOS7
KVM Host and Guest Preprations
SSL Certificate Generations
Configure simple external HAPROXY
Configuring ETCD with SSL on the Master servers
Creation of the POD Network information in ETCD for flanneld
Install and Configure the Master Service on the Kubernetes Master servers
Installation and Configuration of the Kubernetes Slaves
Installation and testing of kube-dns