Skip to content

Commit

Permalink
Fetch the pod's HOSTNAME via downward API and pass it as env.var
Browse files Browse the repository at this point in the history
... when the pod is deployed as part of an StatefulSet, so it can
determine its identity on startup and pick the right config file
from the '*-configfiles' mount.
  • Loading branch information
SamuAlfageme committed Sep 18, 2020
1 parent ed53dd2 commit f9cdb4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion revad/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
name: revad
description: The Reva daemon (revad) helm chart
type: application
version: 1.2.2
version: 1.2.4
appVersion: v1.2.1
icon: https://reva.link/logo.svg
home: https://reva.link
Expand Down
14 changes: 11 additions & 3 deletions revad/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
args:
- "-c"
{{- if .Values.useStatefulSet }}
- "/etc/revad/${HOSTNAME}.toml"
- "/etc/revad/$(HOSTNAME).toml"
{{- else }}
- "/etc/revad/revad.toml"
{{- end }}
Expand All @@ -50,9 +50,17 @@ spec:
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- if .Values.env }}
{{- if or .Values.env .Values.useStatefulSet }}
env:
{{ toYaml .Values.env | nindent 12}}
{{- if .Values.useStatefulSet }}
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- end }}
{{- if .Values.env }}
{{ toYaml .Values.env | nindent 12 }}
{{- end }}
{{- end }}
volumes:
- name: {{ include "revad.fullname" . }}-configfiles
Expand Down

0 comments on commit f9cdb4c

Please sign in to comment.