From 70936d4dbd8226a48a63ea38672f4e2a323bd3d9 Mon Sep 17 00:00:00 2001 From: Eric Smalling Date: Fri, 3 Jan 2020 11:43:41 -0600 Subject: [PATCH] Update cluster health check command for newer etcd (#18392) * Update cluster health check command for newer etcd Existing docs assume the older (v3.2) etcdctl `health-check` command but with a 3.4.3 cluster (which is what kubeadm creates in the static manifest now), that subcommand is no longer supported and returns 404 errors like: ``` root@etcd-1:~# docker run --rm -it --net host -v /etc/kubernetes:/etc/kubernetes quay.io/coreos/etcd:${ETCD_TAG} etcdctl --cert-file /etc/kubernetes/pki/etcd/peer.crt --key-file /etc/kubernetes/pki/etcd/peer.key --ca-file /etc/kubernetes/pki/etcd/ca.crt --endpoints https://10.170.68.181:2379 cluster-health cluster may be unhealthy: failed to list members Error: unexpected status code 404 ``` * PR review changes --- .../tools/kubeadm/setup-ha-etcd-with-kubeadm.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/content/en/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md b/content/en/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md index b1f7f6bb80..708e10569f 100644 --- a/content/en/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md +++ b/content/en/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md @@ -251,15 +251,17 @@ this example. ```sh docker run --rm -it \ --net host \ - -v /etc/kubernetes:/etc/kubernetes quay.io/coreos/etcd:${ETCD_TAG} etcdctl \ - --cert-file /etc/kubernetes/pki/etcd/peer.crt \ - --key-file /etc/kubernetes/pki/etcd/peer.key \ - --ca-file /etc/kubernetes/pki/etcd/ca.crt \ - --endpoints https://${HOST0}:2379 cluster-health + -v /etc/kubernetes:/etc/kubernetes k8s.gcr.io/etcd:${ETCD_TAG} etcdctl \ + --cert /etc/kubernetes/pki/etcd/peer.crt \ + --key /etc/kubernetes/pki/etcd/peer.key \ + --cacert /etc/kubernetes/pki/etcd/ca.crt \ + --endpoints https://${HOST0}:2379 endpoint health --cluster ... - cluster is healthy + https://[HOST0 IP]:2379 is healthy: successfully committed proposal: took = 16.283339ms + https://[HOST1 IP]:2379 is healthy: successfully committed proposal: took = 19.44402ms + https://[HOST2 IP]:2379 is healthy: successfully committed proposal: took = 35.926451ms ``` - - Set `${ETCD_TAG}` to the version tag of your etcd image. For example `v3.2.24`. + - Set `${ETCD_TAG}` to the version tag of your etcd image. For example `3.4.3-0`. To see the etcd image and tag that kubeadm uses execute `kubeadm config images list --kubernetes-version ${K8S_VERSION}`, where `${K8S_VERSION}` is for example `v1.17.0` - Set `${HOST0}`to the IP address of the host you are testing. {{% /capture %}}