Skip to content

Commit d35a868

Browse files
committed
refactor secrets values: move username,password to st2.*
1 parent aa95c1a commit d35a868

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Ingress is enabled. You may access following endpoints:
4040
{{- end }}
4141

4242
2. Login with the following credentials:
43-
username: {{ .Values.secrets.st2.username }}
44-
password: {{ .Values.secrets.st2.password }}
43+
username: {{ .Values.st2.username }}
44+
password: {{ .Values.st2.password }}
4545

4646
3. Use st2 CLI:
4747
export ST2CLIENT=$(kubectl get --namespace {{ .Release.Namespace }} pod -l app=st2client,release={{ .Release.Name }} -o jsonpath="{.items[0].metadata.name}")

templates/secrets_st2auth.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Notify users about breaking change regarding secrets, to not destroy current installations
2+
{{- $deprecated_username := (default (dict) (default (dict) .Values.secrets).st2).username }}
3+
{{- $deprecated_password := (default (dict) (default (dict) .Values.secrets).st2).pasword }}
4+
{{- if or $deprecated_username $deprecated_password }}
5+
{{- fail "Please update your values! Values for username and password moved from secrets.st2.* to st2.*" }}
6+
{{- end }}
17
---
28
apiVersion: v1
39
kind: Secret
@@ -15,6 +21,6 @@ metadata:
1521
type: Opaque
1622
data:
1723
# Username, used to login to StackStorm system (default: st2admin)
18-
username: {{ required "A valid secret 'st2.username' is required for StackStorm auth!" .Values.secrets.st2.username | b64enc | quote }}
24+
username: {{ required "A valid secret 'st2.username' is required for StackStorm auth!" .Values.st2.username | b64enc | quote }}
1925
# Password, used to login to StackStorm system (default: Ch@ngeMe)
20-
password: {{ required "A valid secret 'st2.password' is required for StackStorm auth!" .Values.secrets.st2.password | b64enc | quote }}
26+
password: {{ required "A valid secret 'st2.password' is required for StackStorm auth!" .Values.st2.password | b64enc | quote }}

values.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ serviceAccount:
4141
## StackStorm shared variables
4242
##
4343
st2:
44+
# NB! It's highly recommended to change ALL default secrets:
45+
# username, password, ssh_key, datastore_crypto_key
46+
# Username, used to login to StackStorm system
47+
username: st2admin
48+
# Password, used to login to StackStorm system
49+
password: Ch@ngeMe
50+
4451
# Custom StackStorm config (st2.user.conf) which will apply settings on top of default st2.conf
4552
config: |
4653
[api]
@@ -187,10 +194,6 @@ ingress:
187194
# TODO: Alternatively as part of reorganizing Helm values, consider moving values to existing `st2` and `st2web` sections ? (#14)
188195
secrets:
189196
st2:
190-
# Username, used to login to StackStorm system
191-
username: st2admin
192-
# Password, used to login to StackStorm system
193-
password: Ch@ngeMe
194197
# SSH private key for the 'stanley' system user ('system_user.ssh_key_file' in st2.conf)
195198
# Warning! Replace with your own SSH key!
196199
# TODO: For prod/stable consider auto-generating if no key provided (#15)

0 commit comments

Comments
 (0)