Commit 4503b1d2 authored by Enrico Bocchi's avatar Enrico Bocchi
Browse files

Support extraEnvvars on all pods

parent 8a5cde0a
......@@ -102,6 +102,9 @@ spec:
value: root://{{ include "utils.mgm_fqdn" . }}
- name: EOS_FS_FULL_SIZE_IN_GB
value: {{ default 5 .Values.minFsSizeGb | quote }}
{{- with .Values.extraEnv }}
{{- include "utils.extraEnv" . | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "fst.fullname" . }}-cfgmap-sysconfig-eos
......
......@@ -145,6 +145,24 @@ geotag: ""
#
minFsSizeGb: 5
#
# Additional Extra environment varialbes
# Several formats of defining varialbes are supported, including:
# ```
# extraEnv:
# ENV_VAR1: var1
# ENV_VAR2: var2
# ```
# or
# ```
# extraEnv:
# - name: ENV_VAR1
# value: "var1"
# - name: ENV_VAR2
# value: "var2"
# ```
extraEnv: {}
#
# Manage persistence of data stored by FST,
# namely the actualy bytes of files stored by users is EOS
......
......@@ -51,6 +51,9 @@ spec:
env:
- name: EOS_MGM_URL
value: root://{{ .Values.fusex.config.eos_mgm_alias }}
{{- with .Values.extraEnv }}
{{- include "utils.extraEnv" . | nindent 12 }}
{{- end }}
securityContext:
privileged: true
capabilities:
......
......@@ -38,6 +38,9 @@ spec:
env:
- name: EOS_MGM_URL
value: root://{{ .Values.fusex.config.eos_mgm_alias }}
{{- with .Values.extraEnv }}
{{- include "utils.extraEnv" . | nindent 12 }}
{{- end }}
securityContext:
privileged: true
capabilities:
......
......@@ -39,6 +39,24 @@ customLabels:
probes:
liveness: true
#
# Additional Extra environment varialbes
# Several formats of defining varialbes are supported, including:
# ```
# extraEnv:
# ENV_VAR1: var1
# ENV_VAR2: var2
# ```
# or
# ```
# extraEnv:
# - name: ENV_VAR1
# value: "var1"
# - name: ENV_VAR2
# value: "var2"
# ```
extraEnv: {}
#
# Configuration for fusex.
#
......
......@@ -114,6 +114,9 @@ spec:
env:
- name: LD_PRELOAD
value: "/usr/lib64/libjemalloc.so.1"
{{- with .Values.extraEnv }}
{{- include "utils.extraEnv" . | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "mgm.fullname" . }}-cfgmap-sysconfig-eos
......
......@@ -136,6 +136,24 @@ mgmofs:
# Can be overriden by .Values.global.eos.instancename
instance: ""
#
# Additional Extra environment varialbes
# Several formats of defining varialbes are supported, including:
# ```
# extraEnv:
# ENV_VAR1: var1
# ENV_VAR2: var2
# ```
# or
# ```
# extraEnv:
# - name: ENV_VAR1
# value: "var1"
# - name: ENV_VAR2
# value: "var2"
# ```
extraEnv: {}
#
# Manage persistence of data stored in MGM.
#
......
......@@ -68,11 +68,9 @@ spec:
command: ["/bin/sh", "-c"]
args: ["/opt/eos/xrootd/bin/xrootd -n mq -c /etc/xrd.cf.mq -l /var/log/eos/xrdlog.mq -Rdaemon"]
env:
# Inspiration from cockroachdb, in case we need it:
# - name: STATEFULSET_NAME
# value: {{ template "mq.fullname" . }}
# - name: STATEFULSET_FQDN
# value: {{ template "mq.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
{{- with .Values.extraEnv }}
{{- include "utils.extraEnv" . | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "mq.fullname" . }}-cfgmap-sysconfig-eos
......
......@@ -117,5 +117,23 @@ hostnames:
probes:
liveness: true
#
# Additional Extra environment varialbes
# Several formats of defining varialbes are supported, including:
# ```
# extraEnv:
# ENV_VAR1: var1
# ENV_VAR2: var2
# ```
# or
# ```
# extraEnv:
# - name: ENV_VAR1
# value: "var1"
# - name: ENV_VAR2
# value: "var2"
# ```
extraEnv: {}
# keytab:
# name: default-keytab
......@@ -79,6 +79,9 @@ spec:
value: "true"
- name: LD_PRELOAD
value: "/usr/lib64/libjemalloc.so.1"
{{- with .Values.extraEnv }}
{{- include "utils.extraEnv" . | nindent 12 }}
{{- end }}
securityContext:
privileged: false
allowPrivilegeEscalation: false
......
......@@ -92,6 +92,24 @@ dnsPolicy: ClusterFirst
ports:
xrootd_qdb:
#
# Additional Extra environment varialbes
# Several formats of defining varialbes are supported, including:
# ```
# extraEnv:
# ENV_VAR1: var1
# ENV_VAR2: var2
# ```
# or
# ```
# extraEnv:
# - name: ENV_VAR1
# value: "var1"
# - name: ENV_VAR2
# value: "var2"
# ```
extraEnv: {}
#
# Manage persistence of data stored in QDB,
# namely the instance configuration and the namespace data.
......
{{- /*
Output YAML formatted EnvVar entries for use in a containers.extraEnv field.
Credits to JupyterHub chart -- https://github.com/jupyterhub/helm-chart
*/}}
{{- define "utils.extraEnv" -}}
{{- include "utils.extraEnv.withTrailingNewLine" . | trimSuffix "\n" }}
{{- end }}
{{- define "utils.extraEnv.withTrailingNewLine" -}}
{{- if . }}
{{- /* If extraEnv is a list, we inject it as it is. */}}
{{- if eq (typeOf .) "[]interface {}" }}
{{- . | toYaml }}
{{- /* If extraEnv is a map, we differentiate two cases: */}}
{{- else if eq (typeOf .) "map[string]interface {}" }}
{{- range $key, $value := . }}
{{- /*
- If extraEnv.someKey has a map value, then we add the value as a YAML
parsed list element and use the key as the name value unless its
explicitly set.
*/}}
{{- if eq (typeOf $value) "map[string]interface {}" }}
{{- merge (dict) $value (dict "name" $key) | list | toYaml | println }}
{{- /*
- If extraEnv.someKey has a string value, then we use the key as the
.extraEnvironment variable name for the value.
*/}}
{{- else if eq (typeOf $value) "string" -}}
- name: {{ $key | quote }}
value: {{ $value | quote | println }}
{{- else }}
{{- printf "?.extraEnv.%s had an unexpected type (%s)" $key (typeOf $value) | fail }}
{{- end }}
{{- end }} {{- /* end of range */}}
{{- end }}
{{- end }} {{- /* end of: if . */}}
{{- end }} {{- /* end of definition */}}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment