I have installed Kubernetes on Windows and connected it as a worker to a Linux master following the Microsoft docs https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/joining-windows-workers
docker version
Client:
Version: 18.03.1-ee-3
API version: 1.37
Go version: go1.10.2
Git commit: b9a5c95
Built: Thu Aug 30 18:42:35 2018
OS/Arch: windows/amd64
Experimental: false
Server:
Engine:
Version: 18.03.1-ee-3
API version: 1.37 (minimum version 1.24)
Go version: go1.10.2
Git commit: b9a5c95
Built: Thu Aug 30 18:56:49 2018
OS/Arch: windows/amd64
Experimental: false
kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.4",...}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.4",...}
kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://10.1.0.6:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubernetes-admin
name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
After running the start.ps1 script with the relevant arguments it connects to Kubernetes fine but doesn't resolve any service DNS:
kubectl get nodes
NAME STATUS ROLES AGE VERSION
dckazumstr Ready master 3d v1.11.4
dckazunonprod01 Ready <none> 31m v1.11.4
dckazunonprod02 Ready <none> 18h v1.11.4
dckazuslave Ready <none> 39m v1.11.4
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
consul ClusterIP 10.98.247.75 <none> 8500/TCP 1h
Output on the container has this:
Failed to resolve consul: lookup consul: no such host
The Linux slave is able to resolve the DNS fine:
ping consul
PING consul.default.svc.cluster.local (10.98.247.75) 56(84) bytes of data
Consul is just a test deployment as we already had it working with compose so know it should work.
Due to the errors I ran the component parts of the script manually and get the below errors when running start-kubelet.ps1
E1127 11:19:44.638355 5500 server.go:711] Kubelet needs to run as uid `0`. It is being run as -1
E1127 11:19:46.030649 5500 kubelet_network.go:102] Failed to ensure that nat chain KUBE-MARK-DROP exists: error creating chain "KUBE-MARK-DROP": executable file not found in %PATH%:
E1127 11:19:46.056554 5500 helpers.go:735] eviction manager: failed to construct signal: "allocatableMemory.available" error: system container "pods" not found in metrics
Can anyone tell me if these are ok messages or if the DNS issue is caused by something else?
EDIT: To show options for start.ps1
.\start.ps1 -ManagementIP 10.1.0.4 -ClusterCIDR 10.244.0.0/16 -ServiceCIDR 10.96.0.0/12 -KubeDnsServiceIP 10.96.0.10
To show these details are correct:
kubeadm init --pod-network-cidr=10.244.0.0/16 --service-cidr=10.96.0.0/12
kubectl cluster-info dump
--service-cluster-ip-range=10.96.0.0/12"
kubectl get svc/kube-dns -n kube-system
NAME TYPE CLUSTER-IP
kube-dns ClusterIP 10.96.0.10
kubectl get po --all-namespaces -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
default consul-7cdfb788c4-cn7pm 1/1 Running 0 2d 10.244.2.60 dckazunonprod02 <none>
default consul-7cdfb788c4-k4n4q 1/1 Running 0 2d 10.244.2.61 dckazunonprod02 <none>
default consul-lin-77b87d549c-d5hrc 1/1 Running 0 2d 10.244.0.102 dckazumstr <none>
default consul-lin-77b87d549c-kg6ks 1/1 Running 0 2d 10.244.1.5 dckazuslave <none>
kube-system etcd-dckazumstr 1/1 Running 1 5d 10.1.0.6 dckazumstr <none>
kube-system kube-apiserver-dckazumstr 1/1 Running 1 5d 10.1.0.6 dckazumstr <none>
kube-system kube-controller-manager-dckazumstr 1/1 Running 1 5d 10.1.0.6 dckazumstr <none>
kube-system kube-dns-86c47599bd-kdbz6 3/3 Running 0 5d 10.244.1.2 dckazuslave <none>
kube-system kube-flannel-ds-amd64-j8lxq 1/1 Running 0 5d 10.1.0.6 dckazumstr <none>
kube-system kube-flannel-ds-amd64-xpvl9 1/1 Running 0 5d 10.1.0.7 dckazuslave <none>
kube-system kube-proxy-bbn2l 1/1 Running 1 5d 10.1.0.7 dckazuslave <none>
kube-system kube-proxy-z96b6 1/1 Running 1 5d 10.1.0.6 dckazumstr <none>
kube-system kube-scheduler-dckazumstr 1/1 Running 1 5d 10.1.0.6 dckazumstr
The issue is the same with CoreDNS, this was changed to rule out the DNS service being the issue.