Skip to content

Commit 056df39

Browse files
committed
provide instructions to retrieve the password
Allow kubernetes/kubectl to reveal the password instead of embedding it in NOTEs.txt (which is available in `helm get notes <release name>`). This works for both values provided in values.yaml and anything that is auto-generated. Helm templates all of the files at once, before applying the resources, so we cannot lookup in NOTES what was generated in another file.
1 parent db4d3f2 commit 056df39

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

templates/NOTES.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ Ingress is enabled. You may access following endpoints:
3939
{{- end }}
4040
{{- end }}
4141

42-
2. Login with the following credentials:
42+
2. Get the password needed to login:
43+
kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.data.password}" secret {{ .Release.Name }}-st2-auth | base64 --decode
44+
45+
3. Login with this username and the password retrieved above:
4346
username: {{ .Values.st2.username }}
44-
password: {{ with lookup "v1" "Secret" .Release.Namespace (print .Release.Name "-st2-auth") }}{{ index . "data" "password" }}{{ end }}
4547

46-
3. Use st2 CLI:
48+
4. Use st2 CLI:
4749
export ST2CLIENT=$(kubectl get --namespace {{ .Release.Namespace }} pod -l app=st2client,release={{ .Release.Name }} -o jsonpath="{.items[0].metadata.name}")
4850
kubectl exec -it ${ST2CLIENT} --namespace {{ .Release.Namespace }} -- st2 --version
4951

0 commit comments

Comments
 (0)