Cluster information:
Kubernetes version: minikube version: v1.6.2
commit: 54f28ac5d3a815d1196cd5d57d707439ee4bb392
Cloud being used: bare-metal
Installation method: curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Host OS: Ubuntu 18.04
CNI and version:
CRI and version:
Problem:
I have a 3 docker images. My goal is to prepare proper helm chart and play with networking solutions so that I know how these 3 images should be launched in some customer cloud. For now I am playing around on my own ubuntu laptop and using minikube.
I start the cluster as below
sudo minikube start --feature-gates=SCTPSupport=true --vm-driver=none --alsologtostderr
Later I use kubectl apply
and my .yaml file to deploy the containers/pods. They all start fine but I am unable to ping between them using their domain names. However, I can ping between them using their respective IPs assigned my the cluster.
I followed Debug DNS Resolution and found out the when I start minikube my DNS pods are not even properly running.
$ kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
NAME READY STATUS RESTARTS AGE
coredns-6955765f44-5kqbc 0/1 Running 0 36s
coredns-6955765f44-zpkkp 0/1 Running 0 36s
Since there are known issues with ubuntu regarding inheritted DNS settings and recommendation is to use --resolv-conf flag for kubelet, I had to guess how to actually do it, so I started minikube like this
sudo minikube start --feature-gates=SCTPSupport=true --vm-driver=none --alsologtostderr --extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
But no success.
10.96.0.1 ?
Also a side question which seems a bit relevant. The cluster IP assigned is 10.96.0.1 which I haven’t specified anywhere. Where does minikube get this IP subnet from and why does it assigned that to my cluster?
It is also visible in output of minikube start
[Install]
config:
{KubernetesVersion:v1.17.0 NodeIP:100.87.6.72 NodePort:8443 NodeName:minikube APIServerName:minikubeCA APIServerNames: APIServerIPs: DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin: FeatureGates:SCTPSupport=true ServiceCIDR:10.96.0.0/12 ImageRepository: ExtraOptions:[{Component:kubelet Key:resolv-conf Value:/run/systemd/resolve/resolv.conf}] ShouldLoadCachedImages:false EnableDefaultCNI:false}
Why this is relevant to DNS is because I have seen /etc/resolve.conf files inside my pods once they are launched and nameserver IP seems to be set to an IP within this subnet but pods don’t have any route to it, so there is no way they would have been able to access the nameserver.