Skip to content

Commit

Permalink
Add support for external configmaps using backstage.extraEnvVarsCM
Browse files Browse the repository at this point in the history
Signed-off-by: anessi <anessi@users.noreply.github.com>
  • Loading branch information
anessi committed Nov 22, 2023
1 parent 2dab094 commit 89fb9af
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.6.1
version: 1.7.0
5 changes: 3 additions & 2 deletions charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Backstage Helm Chart

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/backstage)](https://artifacthub.io/packages/search?repo=backstage)
![Version: 1.6.1](https://img.shields.io/badge/Version-1.6.1-informational?style=flat-square)
![Version: 1.7.0](https://img.shields.io/badge/Version-1.7.0-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for deploying a Backstage application
Expand Down Expand Up @@ -123,7 +123,8 @@ Kubernetes: `>= 1.19.0-0`
| backstage.extraAppConfig | Extra app configuration files to inline into command arguments | list | `[]` |
| backstage.extraContainers | Deployment sidecars | list | `[]` |
| backstage.extraEnvVars | Backstage container environment variables | list | `[]` |
| backstage.extraEnvVarsSecrets | Backstage container environment variables from Secrets | list | `[]` |
| backstage.extraEnvVarsCM | Backstage container environment variables from existing ConfigMaps | list | `[]` |
| backstage.extraEnvVarsSecrets | Backstage container environment variables from existing Secrets | list | `[]` |
| backstage.extraVolumeMounts | Backstage container additional volume mounts | list | `[]` |
| backstage.extraVolumes | Backstage container additional volumes | list | `[]` |
| backstage.image.debug | Set to true if you would like to see extra information on logs | bool | `false` |
Expand Down
6 changes: 5 additions & 1 deletion charts/backstage/templates/backstage-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ spec:
{{- if .Values.backstage.startupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.backstage.startupProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.backstage.extraEnvVarsSecrets }}
{{- if (or .Values.backstage.extraEnvVarsCM .Values.backstage.extraEnvVarsSecrets) }}
envFrom:
{{- range .Values.backstage.extraEnvVarsCM }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- range .Values.backstage.extraEnvVarsSecrets }}
- secretRef:
name: {{ . }}
Expand Down
16 changes: 15 additions & 1 deletion charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,20 @@
"title": "Backstage container environment variables",
"type": "array"
},
"extraEnvVarsCM": {
"default": [],
"description": "Translates into array of `envFrom.[].configMapRef.name`",
"examples": [
[
"my-backstage-configmap"
]
],
"items": {
"type": "string"
},
"title": "Backstage container environment variables from existing ConfigMaps",
"type": "array"
},
"extraEnvVarsSecrets": {
"default": [],
"description": "Translates into array of `envFrom.[].secretRef.name`",
Expand All @@ -1525,7 +1539,7 @@
"items": {
"type": "string"
},
"title": "Backstage container environment variables from Secrets",
"title": "Backstage container environment variables from existing Secrets",
"type": "array"
},
"extraVolumeMounts": {
Expand Down
16 changes: 15 additions & 1 deletion charts/backstage/values.schema.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,22 @@
]
]
},
"extraEnvVarsCM": {
"title": "Backstage container environment variables from existing ConfigMaps",
"type": "array",
"description": "Translates into array of `envFrom.[].configMapRef.name`",
"items": {
"type": "string"
},
"default": [],
"examples": [
[
"my-backstage-configmap"
]
]
},
"extraEnvVarsSecrets": {
"title": "Backstage container environment variables from Secrets",
"title": "Backstage container environment variables from existing Secrets",
"type": "array",
"description": "Translates into array of `envFrom.[].secretRef.name`",
"items": {
Expand Down
5 changes: 4 additions & 1 deletion charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ backstage:
# -- Backstage container environment variables
extraEnvVars: []

# -- Backstage container environment variables from Secrets
# -- Backstage container environment variables from existing ConfigMaps
extraEnvVarsCM: []

# -- Backstage container environment variables from existing Secrets
extraEnvVarsSecrets: []

# -- Backstage container additional volume mounts
Expand Down

0 comments on commit 89fb9af

Please sign in to comment.