Skip to content

Commit

Permalink
feat(ad_to_mo_sync): [#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.

The `environment_containing_json` does not seem to serve any purpose,
but was probably copied from an old method of templating the ConfigMap
using a for-loop instead of `toYaml`.

[1] kubernetes/kubernetes#22368
  • Loading branch information
caspervk committed Jun 28, 2023
1 parent 54a9f78 commit 08714b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 35 deletions.
16 changes: 0 additions & 16 deletions os2mo/templates/integrations/ad_to_mo_sync/config.yaml

This file was deleted.

13 changes: 8 additions & 5 deletions os2mo/templates/integrations/ad_to_mo_sync/deployment.yaml
Expand Up @@ -91,11 +91,14 @@ spec:
value: {{ required "AD_SEARCH_BASE must be set" .Values.ad_to_mo_sync.ad_search_base | quote }}
- name: AD_MAPPINGS
value: {{ required "AD_MAPPINGS must be set" .Values.ad_to_mo_sync.ad_mappings | quote }}
envFrom:
- configMapRef:
name: ad-to-mo-sync-config
- configMapRef:
name: ad-to-mo-sync-json-config
{{- range $name, $value := .Values.ad_to_mo_sync.environment }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- range $name, $value := .Values.ad_to_mo_sync.environment_containing_json }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
ports:
- containerPort: 8000
resources:
Expand Down
14 changes: 0 additions & 14 deletions os2mo/templates/integrations/ad_to_mo_sync/json-config.yaml

This file was deleted.

0 comments on commit 08714b6

Please sign in to comment.