Skip to content

Commit

Permalink
Added ability to use environment variables in HelmChart.
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Hoffman <[email protected]>
  • Loading branch information
macintoshme authored and Morgan Hoffman committed Feb 14, 2024
1 parent 6cd27ee commit db6ac0b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/headlamp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sources:
maintainers:
- name: kinvolk
url: https://kinvolk.io/
version: 0.18.1
version: 0.18.2
appVersion: 0.22.0
annotations:
artifacthub.io/category: monitoring-logging
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ See [MAINTAINERS.md](https://github.com/headlamp-k8s/headlamp/blob/main/MAINTAIN
| affinity | object | `{}` | Affinity settings for pod assignment |
| clusterRoleBinding.annotations | object | `{}` | Annotations to add to the cluster role binding |
| clusterRoleBinding.create | bool | `true` | Specified whether a cluster role binding should be created |
| env | list | `[]` | An optional list of environment variables |
| fullnameOverride | string | `""` | Overrides the full name of the chart |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never, IfNotPresent |
| image.registry | string | `"ghcr.io"` | Container image registry |
Expand Down
7 changes: 6 additions & 1 deletion charts/headlamp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{ with .Values.config.oidc }}
{{ if or .Values.config.oidc .Values.env }}
env:
{{- with .Values.config.oidc }}
{{- if or .clientID (not .secret.create) }}
- name: OIDC_CLIENT_ID
valueFrom:
Expand Down Expand Up @@ -65,6 +66,10 @@ spec:
name: {{ .secret.name }}
key: scopes
{{- end }}
{{- end }}
{{- if .Values.env }}
{{- toYaml .Values.env | nindent 12 }}
{{- end }}
{{- end }}
args:
- "-in-cluster"
Expand Down
7 changes: 7 additions & 0 deletions charts/headlamp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ config:
# -- directory to look for plugins
pluginsDir: "/headlamp/plugins"

# -- An optional list of environment variables
# env:
# - name: KUBERNETES_SERVICE_HOST
# value: localhost
# - name: KUBERNETES_SERVICE_PORT
# value: 6443

serviceAccount:
# -- Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit db6ac0b

Please sign in to comment.