Skip to content

Commit 000b93c

Browse files
jennydamanJennings ZhangmmosarafO2
authored
Accept root credentials from existing secret (#119)
Co-authored-by: Jennings Zhang <Jennings.Zhang@childrens.harvard.edu> Co-authored-by: mmosarafO2 <mosraf@openobserve.ai>
1 parent db57167 commit 000b93c

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

charts/openobserve-standalone/templates/openobserve-statefulset.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ spec:
8686
- secretRef:
8787
name: {{ include "openobserve.fullname" . }}
8888
env:
89+
{{- if .Values.auth.existingRootUserSecret.name }}
90+
- name: ZO_ROOT_USER_EMAIL
91+
valueFrom:
92+
secretKeyRef:
93+
name: {{ .Values.auth.existingRootUserSecret.name }}
94+
key: {{ .Values.auth.existingRootUserSecret.emailKey }}
95+
- name: ZO_ROOT_USER_PASSWORD
96+
valueFrom:
97+
secretKeyRef:
98+
name: {{ .Values.auth.existingRootUserSecret.name }}
99+
key: {{ .Values.auth.existingRootUserSecret.passwordKey }}
100+
{{- end }}
89101
{{- with .Values.extraEnv }}
90102
{{- toYaml . | nindent 12 }}
91103
{{- end }}

charts/openobserve-standalone/templates/secret.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ metadata:
1010
{{- end }}
1111
type: Opaque
1212
stringData:
13+
{{- if not .Values.auth.existingRootUserSecret.name }}
1314
ZO_ROOT_USER_EMAIL: "{{ .Values.auth.ZO_ROOT_USER_EMAIL }}"
1415
ZO_ROOT_USER_PASSWORD: "{{ .Values.auth.ZO_ROOT_USER_PASSWORD }}"
1516
ZO_ROOT_USER_TOKEN: "{{ .Values.auth.ZO_ROOT_USER_TOKEN }}"
17+
{{- end }}
1618
{{- if not .Values.minio.enabled }}
1719
ZO_S3_ACCESS_KEY: "{{ .Values.auth.ZO_S3_ACCESS_KEY }}"
1820
{{- else }}
@@ -31,4 +33,4 @@ stringData:
3133
AZURE_STORAGE_ACCOUNT_KEY: "{{ .Values.config.AZURE_STORAGE_ACCOUNT_KEY }}"
3234
AZURE_STORAGE_ACCOUNT_NAME: "{{ .Values.config.AZURE_STORAGE_ACCOUNT_NAME }}"
3335
{{- end }}
34-
{{- end }}
36+
{{- end }}

charts/openobserve-standalone/templates/zplane-deployment.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,23 @@ spec:
5151
{{- toYaml .Values.zplane.resources | nindent 12 }}
5252
env:
5353
- name: ZPLANE_ZO_USERNAME
54-
value: "{{ .Values.auth.ZO_ROOT_USER_EMAIL }}"
54+
{{- if .Values.auth.existingRootUserSecret.name }}
55+
valueFrom:
56+
secretKeyRef:
57+
name: {{ .Values.auth.existingRootUserSecret.name }}
58+
key: {{ .Values.auth.existingRootUserSecret.emailKey }}
59+
{{- else }}
60+
value: {{ .Values.auth.ZO_ROOT_USER_EMAIL | quote }}
61+
{{- end }}
5562
- name: ZPLANE_ZO_PASSWORD
56-
value: "{{ .Values.auth.ZO_ROOT_USER_PASSWORD }}"
63+
{{- if .Values.auth.existingRootUserSecret.name }}
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ .Values.auth.existingRootUserSecret.name }}
67+
key: {{ .Values.auth.existingRootUserSecret.passwordKey }}
68+
{{- else }}
69+
value: {{ .Values.auth.ZO_ROOT_USER_PASSWORD | quote }}
70+
{{- end }}
5771
- name: ZPLANE_ZO_ENDPOINT
5872
value: "http://{{ include "openobserve.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.service.port }}"
5973

charts/openobserve-standalone/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,22 @@ headless:
6666

6767
# Credentials for authentication
6868
auth:
69+
# Either specify root user credentials here, or use an existing secret.
70+
71+
# OpenObserve root user email
6972
ZO_ROOT_USER_EMAIL: "root@example.com"
73+
# OpenObserve root user password
7074
ZO_ROOT_USER_PASSWORD: "Complexpass#123"
7175
ZO_ROOT_USER_TOKEN: ""
7276

77+
existingRootUserSecret:
78+
# Existing secret with OpenObserve root user credentials.
79+
name: ""
80+
# Email key to be retrieved from existing secret
81+
emailKey: "ZO_ROOT_USER_EMAIL"
82+
# Password key to be retrieved from existing secret
83+
passwordKey: "ZO_ROOT_USER_PASSWORD"
84+
7385
# do not need to set this if enabled minio is being used. settings will be picked from minio section. Also IRSA is preferred if on EKS. Set the Service account section with the correct IAM role ARN. Refer https://zinc.dev/docs/guide/ha_deployment/#amazon-eks-s3
7486
ZO_S3_ACCESS_KEY: ""
7587
ZO_S3_SECRET_KEY: ""

0 commit comments

Comments
 (0)