Minor improvements

This commit is contained in:
tompizmor
2018-06-29 11:19:30 +02:00
parent 9e950c9657
commit a05952290a
2 changed files with 5 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ To connect to your etcd server from outside the cluster execute the following co
{{ if .Values.auth.rbac.enabled }} {{ 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: * 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 }} {{ end }}
{{- if .Values.auth.client.secureTransport }} {{- if .Values.auth.client.secureTransport }}

View File

@@ -112,6 +112,7 @@ spec:
## Setting up new cluster ## Setting up new cluster
else else
echo "==> There is no data at all. Creating new cluster" 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 & store_member_id &
@@ -120,9 +121,9 @@ spec:
etcd > /dev/null 2>&1 & etcd > /dev/null 2>&1 &
ETCD_PID=$! ETCD_PID=$!
sleep 5 sleep 5
echo "$ETCD_ROOT_PASSWORD" | etcdctl user add root echo "$ETCD_ROOT_PASSWORD" | ${AUTH_OPTIONS} etcdctl user add root
etcdctl auth enable etcdctl ${AUTH_OPTIONS} auth enable
etcdctl -u root:"$ETCD_ROOT_PASSWORD" role revoke guest -path '/*' --readwrite etcdctl ${AUTH_OPTIONS} role revoke guest -path '/*' --readwrite
kill $ETCD_PID kill $ETCD_PID
sleep 5 sleep 5
fi fi