Skip to content

Commit

Permalink
feat(orgviewer): [#48311] template environment variables directly
Browse files Browse the repository at this point in the history
Previously, environment variables were templated into a ConfigMap which
was referenced through an `envFrom` in the deployment. Unfortunately,
Kubernetes does not restart deployments on changes to their referenced
ConfigMaps[1], so this indirection means that deployments have to be
restarted manually every time a change is made - something that is very
easy to forget in an otherwise GitOpsy workflow.

[1] kubernetes/kubernetes#22368
  • Loading branch information
caspervk committed Jun 28, 2023
1 parent 8e40287 commit 04839e3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
7 changes: 5 additions & 2 deletions os2mo/templates/orgviewer/adm/deployment.yaml
Expand Up @@ -59,9 +59,12 @@ spec:
- name: VUE_APP_TREE_LAYOUT
value: "vertical"

{{- range $name, $value := .Values.orgviewer.environment }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}

envFrom:
- configMapRef:
name: orgviewer-environment-config
- configMapRef:
name: orgviewer-adm-config
ports:
Expand Down
3 changes: 3 additions & 0 deletions os2mo/templates/orgviewer/client-secret.yaml
Expand Up @@ -2,6 +2,9 @@
#
# SPDX-License-Identifier: MPL-2.0
{{- if or .Values.orgviewer.med.enabled .Values.orgviewer.adm.enabled }}
{{- if not (or .Values.os2mo.environment.KEYCLOAK_RBAC_ENABLED .Values.os2mo.environment.keycloak_rbac_enabled) }}
{{- fail "You cannot deploy orgviewer without enabling RBAC in os2mo." -}}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
21 changes: 0 additions & 21 deletions os2mo/templates/orgviewer/configmap.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions os2mo/templates/orgviewer/med/deployment.yaml
Expand Up @@ -59,9 +59,12 @@ spec:
- name: VUE_APP_TREE_LAYOUT
value: "vertical"

{{- range $name, $value := .Values.orgviewer.environment }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}

envFrom:
- configMapRef:
name: orgviewer-environment-config
- configMapRef:
name: orgviewer-med-config
ports:
Expand Down

0 comments on commit 04839e3

Please sign in to comment.