Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.idea/
# Build artifacts
cli/cli
ui/ui
service/service
3 changes: 0 additions & 3 deletions charts/feature/templates/cli-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ data:
ENDPOINT: {{ default (printf "%s:%v" (include "feature.fullname" .) .Values.service.service.port) .Values.cli.endpoint | quote }}
OPENTELEMETRY_ENABLED: {{ ternary "true" "false" .Values.cli.opentelemetry.enabled | quote }}
OPENTELEMETRY_ENDPOINT: {{ .Values.cli.opentelemetry.endpoint | quote }}
{{- if .Values.service.authentication.enabled }}
USERNAME: {{ .Values.service.authentication.username | quote }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/feature/templates/cli-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
name: {{ include "feature.cli.fullname" . }}
{{- if .Values.service.authentication.enabled }}
- secretRef:
name: {{ printf "%s-auth" (include "feature.fullname" .) }}
name: {{ printf "%s-cli-auth" (include "feature.fullname" .) }}
{{- end }}
{{- with .Values.cli.resources }}
resources:
Expand Down
25 changes: 25 additions & 0 deletions charts/feature/templates/cli-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if and .Values.cli.enabled .Values.service.authentication.enabled }}
{{- $secretName := printf "%s-cli-auth" (include "feature.fullname" .) }}
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $secretName }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
labels:
{{- include "feature.labels" . | nindent 4 }}
app.kubernetes.io/component: cli
type: Opaque
data:
{{- $password := .Values.service.authentication.password }}
{{- if and $existingSecret $existingSecret.data (index $existingSecret.data "PASSWORD") }}
{{- /* Preserve existing password on upgrades */ -}}
PASSWORD: {{ index $existingSecret.data "PASSWORD" | quote }}
{{- else }}
{{- /* Generate new password only on first install or when explicitly set */ -}}
{{- if eq $password "" }}
{{- $password = randAlphaNum 24 }}
{{- end }}
PASSWORD: {{ $password | b64enc | quote }}
{{- end }}
USERNAME: {{ .Values.service.authentication.username | b64enc | quote }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/feature/templates/service-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
type: Opaque
data:
{{- $password := .Values.service.authentication.password }}
{{- if and $existingSecret $existingSecret.data }}
{{- if and $existingSecret $existingSecret.data (index $existingSecret.data "AUTHENTICATION_PASSWORD") }}
{{- /* Preserve existing password on upgrades */ -}}
AUTHENTICATION_PASSWORD: {{ index $existingSecret.data "AUTHENTICATION_PASSWORD" | quote }}
{{- else }}
Expand All @@ -21,4 +21,5 @@ data:
{{- end }}
AUTHENTICATION_PASSWORD: {{ $password | b64enc | quote }}
{{- end }}
AUTHENTICATION_USERNAME: {{ .Values.service.authentication.username | b64enc | quote }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/feature/templates/ui-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ data:
SUBPATH: {{ .Values.ui.subpath | quote }}
OPENTELEMETRY_ENABLED: {{ ternary "true" "false" .Values.cli.opentelemetry.enabled | quote }}
OPENTELEMETRY_ENDPOINT: {{ .Values.cli.opentelemetry.endpoint | quote }}
{{- if .Values.service.authentication.enabled }}
AUTHENTICATION_ENABLED: "true"
{{- end }}
{{- end }}