2
votes

Environment:

Kubernetes version (use kubectl version): v1.7.0
Cloud provider or hardware configuration**:
OS (e.g. from /etc/os-release): CentOS 7
Kernel (e.g. uname -a): Linux k8s-master 3.10.0-514.6.2.el7.x86_64
Install tools: Kubeadm
Others:
docker version : Docker version 1.12.6,
My RPM version :
docker-1.12.6-16.el7.centos.x86_64.rpm
kubectl-1.7.0-0.x86_64.rpm
kubernetes-cni-0.5.1-0.x86_64.rpm
kubeadm-1.7.0-0.x86_64.rpm
kubelet-1.7.0-0.x86_64.rpm

this command from official document ,but it seems my cluster has no healthz container,am i miss something?

[root@k8s-master ~]# kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name) -c healthz
Error from server (BadRequest): container healthz is not valid for pod kube-dns-2425271678-cqm2n


[root@k8s-master ~]# kubectl get pods --all-namespaces -o wide
NAMESPACE     NAME                                    READY     STATUS     RESTARTS   AGE       IP              NODE
default       busybox                                 1/1       Running   1          1h        172.16.2.7      k8s-node2
kube-system   etcd-k8s-master                         1/1       Running   0          21h       10.132.41.234   k8s-master
kube-system   heapster-2994581613-7ppn7               1/1       Running   0          20h       172.16.2.6      k8s-node2
kube-system   kube-apiserver-k8s-master               1/1       Running   0          21h       10.132.41.234   k8s-master
kube-system   kube-controller-manager-k8s-master      1/1       Running   0          21h       10.132.41.234   k8s-master
kube-system   kube-dns-2425271678-cqm2n               3/3       Running   0          21h       172.16.0.2      k8s-master
kube-system   kube-flannel-ds-18dr4                   2/2       Running   0          20h       10.132.41.234   k8s-master
kube-system   kube-flannel-ds-vpkpb                   2/2       Running   0          20h       10.165.97.219   k8s-node1
kube-system   kube-flannel-ds-x3n24                   2/2       Running   0          20h       10.161.233.80   k8s-node2
kube-system   kube-proxy-2xhn9                        1/1       Running   0          21h       10.132.41.234   k8s-master
kube-system   kube-proxy-7hmmx                        1/1       Running   0          20h       10.165.97.219   k8s-node1
kube-system   kube-proxy-h1gmc                        1/1       Running   0          20h       10.161.233.80   k8s-node2
kube-system   kube-scheduler-k8s-master               1/1       Running   0          21h       10.132.41.234   k8s-master
kube-system   kubernetes-dashboard-2209332821-038fw   1/1       Running   0          20h       172.16.1.2      k8s-node1
kube-system   monitoring-grafana-1850655027-vwzcw     1/1       Running   0          20h       172.16.2.5      k8s-node2
kube-system   monitoring-influxdb-1870447071-vx3md    1/1       Running   0          20h       172.16.1.3      k8s-node1


[root@k8s-master ~]# docker ps |grep dns
d3668f0904fb        3e08c89ee425                                                                                     "/kube-dns --domain=c"   20 hours ago        Up 20 hours                             k8s_kubedns_kube-dns-2425271678-cqm2n_kube-system_42298b87-7032-11e7-a792-00163e024627_0
5ddf2d4f6adb        db8241b72199                                                                                     "/sidecar --v=2 --log"   20 hours ago        Up 20 hours                             k8s_sidecar_kube-dns-2425271678-cqm2n_kube-system_42298b87-7032-11e7-a792-00163e024627_0
101119787b35        1813641c1a74                                                                                     "/dnsmasq-nanny -v=2 "   20 hours ago        Up 20 hours                             k8s_dnsmasq_kube-dns-2425271678-cqm2n_kube-system_42298b87-7032-11e7-a792-00163e024627_0
1d80ad4754a3        gcr.io/google_containers/pause-amd64:3.0                                                         "/pause"                 20 hours ago        Up 20 hours                             k8s_POD_kube-dns-2425271678-cqm2n_kube-system_42298b87-7032-11e7-a792-00163e024627_0
1

1 Answers

0
votes

The option -c healthz is asking for the container with name healthz, which doesn't exist. You could instead use -c kube-dns or -c sidecar.