From f0cdf024792f4d283426d734eb564c8b843265b7 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Thu, 25 Nov 2021 09:49:37 -0500 Subject: [PATCH] Added a configmap example --- charts/demo-helm/templates/backend.yaml | 6 ++++++ charts/demo-helm/templates/configmap.yaml | 6 ++++++ charts/demo-helm/values.yaml | 1 + 3 files changed, 13 insertions(+) create mode 100644 charts/demo-helm/templates/configmap.yaml diff --git a/charts/demo-helm/templates/backend.yaml b/charts/demo-helm/templates/backend.yaml index e80c200..87d7c4d 100644 --- a/charts/demo-helm/templates/backend.yaml +++ b/charts/demo-helm/templates/backend.yaml @@ -27,6 +27,12 @@ spec: imagePullPolicy: Always ports: - containerPort: 5000 + env: + - name: RANDOM_DATA + valueFrom: + configMapKeyRef: + name: {{ $.Release.Name }}-{{ $.Chart.Name}}-configmap + key: random_data imagePullSecrets: - name: {{ $.Values.image_pull_secret }} {{- end }} diff --git a/charts/demo-helm/templates/configmap.yaml b/charts/demo-helm/templates/configmap.yaml new file mode 100644 index 0000000..17c52b9 --- /dev/null +++ b/charts/demo-helm/templates/configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $.Release.Name }}-{{ $.Chart.Name}}-configmap +data: + random_data: {{ .Values.random | quote }} \ No newline at end of file diff --git a/charts/demo-helm/values.yaml b/charts/demo-helm/values.yaml index 8b29763..ac0e6de 100644 --- a/charts/demo-helm/values.yaml +++ b/charts/demo-helm/values.yaml @@ -9,3 +9,4 @@ services: image_name: "registry.runcible.io/demo-helm-backend" image_version: "1.1.0" replicas: 1 +random: "tis-random-default" \ No newline at end of file