diff --git a/bitnami/etcd/templates/NOTES.txt b/bitnami/etcd/templates/NOTES.txt index 7cbb870667..ae0aab1159 100644 --- a/bitnami/etcd/templates/NOTES.txt +++ b/bitnami/etcd/templates/NOTES.txt @@ -56,7 +56,7 @@ To connect to your etcd server from outside the cluster execute the following co {{ if .Values.auth.rbac.enabled }} * As rbac is enabled you should add the flag `-u root:$ETCD_ROOT_PASSWORD` to the etcdctl commands. Export the password with this command: - export ETCD_ROOT_PASSWORD=${kubectl get secret --namespace {{ .Release.Namespace }} {{ template "etcd.fullname" . }} -o jsonpath="{.data.etcd-root-password}" | base64 --decode)} + export ETCD_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "etcd.fullname" . }} -o jsonpath="{.data.etcd-root-password}" | base64 --decode) {{ end }} {{- if .Values.auth.client.secureTransport }} diff --git a/bitnami/etcd/templates/statefulset.yaml b/bitnami/etcd/templates/statefulset.yaml index ae8b861520..a545cbebc9 100644 --- a/bitnami/etcd/templates/statefulset.yaml +++ b/bitnami/etcd/templates/statefulset.yaml @@ -112,6 +112,7 @@ spec: ## Setting up new cluster else echo "==> There is no data at all. Creating new cluster" + export ETCDCTL_ENDPOINTS="{{ $etcdClientProtocol }}://{{ $etcdFullname }}-0.{{ $etcdHeadlessServiceName }}.default.svc.cluster.local:{{ $clientPort }}" store_member_id & @@ -120,9 +121,9 @@ spec: etcd > /dev/null 2>&1 & ETCD_PID=$! sleep 5 - echo "$ETCD_ROOT_PASSWORD" | etcdctl user add root - etcdctl auth enable - etcdctl -u root:"$ETCD_ROOT_PASSWORD" role revoke guest -path '/*' --readwrite + echo "$ETCD_ROOT_PASSWORD" | ${AUTH_OPTIONS} etcdctl user add root + etcdctl ${AUTH_OPTIONS} auth enable + etcdctl ${AUTH_OPTIONS} role revoke guest -path '/*' --readwrite kill $ETCD_PID sleep 5 fi