diff --git a/troubleshooting/error_rolling_back_service_chart_with_etcd.md b/troubleshooting/error_rolling_back_service_chart_with_etcd.md index a33f3ace66530..1934bb41e8c55 100644 --- a/troubleshooting/error_rolling_back_service_chart_with_etcd.md +++ b/troubleshooting/error_rolling_back_service_chart_with_etcd.md @@ -1,6 +1,6 @@ # Error Rolling Back Service Chart With etcd -If rolling back a service with Bitnami etcd, the `helm rollback` could fail when going from an etcd chart version 9.x to an etcd chart version 8.x. +If rolling back a service with Bitnami etcd, the `helm rollback` could fail when going from an etcd chart 9.x version to an etcd chart 8.x version. This is because the Bitnami 9.x etcd cluster StatefulSet and Pods have the `app.kubernetes.io/component=etcd` label and the Bitnami 8.x etcd cluster StatefulSet and Pods do not, causing the StatefulSet to complain on rollback. diff --git a/troubleshooting/scripts/remove_label_from_etcd_cluster.sh b/troubleshooting/scripts/remove_label_from_etcd_cluster.sh index 0733d11017f76..a80457ea46526 100755 --- a/troubleshooting/scripts/remove_label_from_etcd_cluster.sh +++ b/troubleshooting/scripts/remove_label_from_etcd_cluster.sh @@ -48,12 +48,12 @@ label_key="app.kubernetes.io/component" label_value="etcd" label="${label_key}=${label_value}" -if ! kubectl get endpoints ${cluster}-etcd-client -n ${ns} -o json > /dev/null 2>&1 ; then +if ! kubectl get endpoints ${cluster}-etcd-client -n ${ns} -o json > /dev/null 2>&1; then # # There is no old etcd-operator managed chart installed, let's see if this # is a fresh install or upgrade with new label. # - has_label=$(kubectl get statefulsets.apps -n ${ns} -l ${label} --no-headers 2>/dev/null | awk "/${ss_name}/") + has_label=$(kubectl get statefulsets.apps -n ${ns} -l ${label} --no-headers 2> /dev/null | awk "/${ss_name}/") if [ -z "$has_label" ]; then # # The new label has not been applied, so no need to delete label before rollback. @@ -67,7 +67,7 @@ if ! kubectl get endpoints ${cluster}-etcd-client -n ${ns} -o json > /dev/null 2 # statefulset before rolling back. # members=$(kubectl get pod -n $ns -o wide -o=custom-columns=NAME:.metadata.name | awk "/${ss_name}/ && !/snapshotter|defrag/") - if [ -n "$members" ]; then + if [ -n "$members" ]; then echo "Ensuring ${ss_name} members do not have '${label}' label for rollback to bitnami 8.x chart..." for member in ${members}; do echo "Removing '${label}' label from ${member}..."