From cb45d77db238e4e74c53ae9e24902dd59b5aa823 Mon Sep 17 00:00:00 2001 From: Laura Hinson Date: Wed, 15 Jan 2025 12:11:08 -0500 Subject: [PATCH] Updating HCP procedure to take etcd snapshot --- modules/backup-etcd-hosted-cluster.adoc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/backup-etcd-hosted-cluster.adoc b/modules/backup-etcd-hosted-cluster.adoc index 2a479ee740a8..78c4fc34fdde 100644 --- a/modules/backup-etcd-hosted-cluster.adoc +++ b/modules/backup-etcd-hosted-cluster.adoc @@ -54,6 +54,7 @@ The following example uses signature version 2. If you are in a region that supp [source,terminal] ---- BUCKET_NAME=somebucket +CLUSTER_NAME=cluster_name FILEPATH="/${BUCKET_NAME}/${CLUSTER_NAME}-snapshot.db" CONTENT_TYPE="application/x-compressed-tar" DATE_VALUE=`date -R` @@ -61,6 +62,7 @@ SIGNATURE_STRING="PUT\n\n${CONTENT_TYPE}\n${DATE_VALUE}\n${FILEPATH}" ACCESS_KEY=accesskey SECRET_KEY=secret SIGNATURE_HASH=`echo -en ${SIGNATURE_STRING} | openssl sha1 -hmac ${SECRET_KEY} -binary | base64` +HOSTED_CLUSTER_NAMESPACE=hosted_cluster_namespace oc exec -it etcd-0 -n ${HOSTED_CLUSTER_NAMESPACE} -- curl -X PUT -T "/var/lib/data/snapshot.db" \ -H "Host: ${BUCKET_NAME}.s3.amazonaws.com" \ @@ -89,6 +91,20 @@ $ oc get secret -etcd-encryption-key -o=jsonpath='{.data.ke + You can decrypt this key when restoring a snapshot on a new cluster. +. Restart all etcd-writer deployments by entering the following command: ++ +[source,terminal] +---- +$ oc scale deployment -n --replicas=3 kube-apiserver openshift-apiserver openshift-oauth-apiserver +---- + +. Resume the reconciliation of the hosted cluster by entering the following command: ++ +[source,terminal] +---- +$ oc patch -n -p '[\{"op": "remove", "path": "/spec/pausedUntil"}]' --type=json +---- + .Next steps -Restore the etcd snapshot. +Restore the etcd snapshot. \ No newline at end of file