Skip to content

Commit

Permalink
feat: Helm chart supports setting of arbitrary environment variables (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dadrus authored Jan 17, 2023
1 parent 99691ef commit 80de2ee
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
14 changes: 13 additions & 1 deletion charts/heimdall/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ helm repo update

== Installing the Chart

This chart expects a https://dadrus.github.io/heimdall/dev/docs/configuration/reference/configuration_reference/[heimdall configuration file] with authentication, authorization and so on mechanisms, required for your particular setup. This file can be passed by using the `-f heimdall.yaml` flag during the installation.
This chart supports setting of any environment variables for the deployment, e.g. to provide OTEL configuration. All environment variables must be configured under an `env` key. E.g. `helm install my-release --set env.MY_ENV=env-value dadrus/heimdall`

If you need to override the name of the heimdall resources such as the deployment or services, the traditional `nameOverride` and `fullnameOverride` properties are supported.

Expand Down Expand Up @@ -390,4 +390,16 @@ a| `service.management.name`

The name of the port exposed by the k8s Service created for heimdall's management endpoint.
a| `management`

a| `env`

Environment variables, which should be made available to the heimdall deployment. E.g.

```.yaml
env:
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://tempo.tempo.svc.cluster.local:4317
```

a| `{}` (empty map)
|===
1 change: 1 addition & 0 deletions charts/heimdall/templates/demo/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ metadata:
data:
heimdall.yaml: |
log:
format: gelf
level: info
rules:
Expand Down
7 changes: 7 additions & 0 deletions charts/heimdall/templates/heimdall/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ spec:
- name: {{ include "heimdall.name" . }}-config-volume
mountPath: /etc/heimdall
readOnly: true
{{- if .Values.env }}
env:
{{- range $key, $val := .Values.env }}
- name: {{ $key }}
value: {{ $val }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /.well-known/health
Expand Down
3 changes: 3 additions & 0 deletions charts/heimdall/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ service:
# Service port name
name: management

# Configures arbitrary environment variables for the deployment
env: {}

# heimdall config defaults
# DO NOT OVERRIDE the values here. Use heimdall config yaml file instead!
# If you create your own values.yaml file, copy the below contents to it as well.
Expand Down

0 comments on commit 80de2ee

Please sign in to comment.