From 7f954c64be8cf7e62c30fd9e120f94cc6cdde08c Mon Sep 17 00:00:00 2001 From: EKS Distro PR Bot <75336432+eks-distro-pr-bot@users.noreply.github.com> Date: Tue, 21 Nov 2023 14:20:32 -0600 Subject: [PATCH] Update etcd backup restore doc cmd when grabbing etcd container id (#7074) Co-authored-by: Jiayi Wang --- .../etcd-backup-restore/bottlerocket-etcd-backup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/clustermgmt/etcd-backup-restore/bottlerocket-etcd-backup.md b/docs/content/en/docs/clustermgmt/etcd-backup-restore/bottlerocket-etcd-backup.md index 1dbb444705d6..aec88f0e661f 100644 --- a/docs/content/en/docs/clustermgmt/etcd-backup-restore/bottlerocket-etcd-backup.md +++ b/docs/content/en/docs/clustermgmt/etcd-backup-restore/bottlerocket-etcd-backup.md @@ -60,7 +60,7 @@ Make sure to setup the [admin environment variables]({{< relref "#admin-machine- 1. Set these environment variables ```bash # get the container ID corresponding to etcd pod - export ETCD_CONTAINER_ID=$(ctr -n k8s.io c ls | grep -w "etcd-io" | cut -d " " -f1) + export ETCD_CONTAINER_ID=$(ctr -n k8s.io c ls | grep -w "etcd-io" | head -1 | cut -d " " -f1) # get the etcd endpoint export ETCD_ENDPOINT=$(cat /etc/kubernetes/manifests/etcd | grep -wA1 ETCD_ADVERTISE_CLIENT_URLS | tail -1 | grep -oE '[^ ]+$') @@ -172,7 +172,7 @@ Make sure to setup the [admin environment variables]({{< relref "#admin-machine- export INITIAL_CLUSTER_TOKEN="etcd-cluster-1" # get the container ID corresponding to etcd pod - export ETCD_CONTAINER_ID=$(ctr -n k8s.io c ls | grep -w "etcd-io" | cut -d " " -f1) + export ETCD_CONTAINER_ID=$(ctr -n k8s.io c ls | grep -w "etcd-io" | head -1 | cut -d " " -f1) # run the restore command ctr -n k8s.io t exec -t --exec-id etcd ${ETCD_CONTAINER_ID} etcdctl \