@@ -4,24 +4,27 @@ Default the derivable substitution values.
44This keeps the length of the values.txt file for each individual IOC
55to a minimum
66*/ -}}
7- {{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}}
8- {{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}}
7+ {{- $location := default .Values.global.location .Values.location | default "" -}}
8+ # for epics-containers services repos, ioc_group is set in services/values.yaml
9+ {{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | default "" -}}
10+ # for epics-containers services repos, opisClaim is named after the ioc_group in services/values.yaml
11+ # for non-epics-containers services repos, opisClaim should be set in the service values.yaml
912{{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}}
10- {{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}}
11- {{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}}
1213{{- $image := .Values.image | required "ERROR - You must supply image." -}}
1314
14- {{- $enabled := eq .Values.global.enabled false | ternary false true - }}
15+ {{- $enabled := eq .Values.global.enabled false | ternary false true }}
1516
1617apiVersion : apps/v1
1718kind : StatefulSet
1819metadata :
1920 name : {{ .Release.Name }}
2021 labels :
21- location : {{ $location }}
22+ location : {{ $location | quote }}
23+ {{- with $ioc_group }}
2224 ioc_group : {{ $ioc_group }}
25+ {{- end }}
2326 enabled : {{ $enabled | quote }}
24- is_ioc : " true "
27+ is_ioc : {{ .Values.is_ioc | quote }}
2528 {{- include "fastcs.labels" . | nindent 4 }}
2629spec :
2730 replicas : {{ $enabled | ternary 1 0 }}
@@ -35,10 +38,12 @@ spec:
3538 {{- toYaml . | nindent 8 }}
3639 {{- end }}
3740 labels :
38- location : {{ $location }}
41+ location : {{ $location | quote }}
42+ {{- with $ioc_group }}
3943 ioc_group : {{ $ioc_group }}
44+ {{- end }}
4045 enabled : {{ $enabled | quote }}
41- is_ioc : " true "
46+ is_ioc : {{ .Values.is_ioc | quote }}
4247 {{- include "fastcs.labels" . | nindent 8 }}
4348 {{- with .Values.podLabels }}
4449 {{- toYaml . | nindent 8 }}
@@ -79,16 +84,16 @@ spec:
7984 image : {{ .image }}
8085 imagePullPolicy : {{ $.Values.image.pullPolicy }}
8186 # a writable place to have cwd
82- workingDir : /epics/runtime
87+ workingDir : /tmp
8388 env :
8489 - name : HOME
85- value : /epics/runtime
90+ value : /tmp
8691 - name : TERM
8792 value : xterm-256color
88- {{- with $.Values.globalEnv }}
93+ {{- with $.Values.env }}
8994 {{- toYaml . | nindent 12}}
9095 {{- end }}
91- {{- with $.Values.iocEnv }}
96+ {{- with $.Values.global.env }}
9297 {{- toYaml . | nindent 12}}
9398 {{- end }}
9499 {{- with $.Values.securityContext }}
@@ -103,17 +108,13 @@ spec:
103108 {{- with $.Values.volumeMounts }}
104109 {{- toYaml . | nindent 12 }}
105110 {{- end }}
106- - name : runtime-volume
107- mountPath : /epics/runtime
108- subPath : {{ $.Release.Name }}
111+ {{- with $.Values.opisMountPoint }}
109112 - name : opis-volume
110- mountPath : /epics/opi
111- subPath : {{ $.Release.Name }}
112- - name : autosave-volume
113- mountPath : /autosave
113+ mountPath : .
114114 subPath : {{ $.Release.Name }}
115+ {{- end }}
115116 - name : config-volume
116- mountPath : {{ $.Values.iocConfig }}
117+ mountPath : {{ $.Values.configFolder }}
117118 {{- if $.Values.editable }}
118119 - name : {{ $.Release.Name }}-develop
119120 mountPath : /dest
@@ -123,16 +124,16 @@ spec:
123124 image : ' {{ .Values.image.repository }}{{ ternary "-debug" "" .Values.editable }}:{{ .Values.image.tag }}'
124125 {{- with .Values.securityContext }}
125126 # a writable place to have cwd
126- workingDir : /epics/runtime
127+ workingDir : /tmp
127128 env :
128129 - name : HOME
129- value : /epics/runtime
130+ value : /tmp
130131 - name : TERM
131132 value : xterm-256color
132- {{- with $.Values.globalEnv }}
133+ {{- with $.Values.env }}
133134 {{- toYaml . | nindent 12}}
134135 {{- end }}
135- {{- with $.Values.iocEnv }}
136+ {{- with $.Values.global.env }}
136137 {{- toYaml . | nindent 12}}
137138 {{- end }}
138139 securityContext :
@@ -170,17 +171,13 @@ spec:
170171 {{- with .Values.volumeMounts }}
171172 {{- toYaml . | nindent 12 }}
172173 {{- end }}
173- - name : runtime-volume
174- mountPath : /epics/runtime
175- subPath : {{ .Release.Name }}
174+ {{- if $.Values.mountEpicsOpis | default true }}
176175 - name : opis-volume
177176 mountPath : /epics/opi
178- subPath : {{ .Release.Name }}
179- - name : autosave-volume
180- mountPath : /autosave
181- subPath : {{ .Release.Name }}
177+ subPath : {{ $.Release.Name }}
178+ {{- end }}
182179 - name : config-volume
183- mountPath : {{ .Values.iocConfig }}
180+ mountPath : {{ .Values.configFolder }}
184181 {{- if .Values.editable }}
185182 - name : {{ .Release.Name }}-develop
186183 mountPath : /workspaces
@@ -193,15 +190,12 @@ spec:
193190 {{- with .Values.volumes }}
194191 {{- toYaml . | nindent 8 }}
195192 {{- end }}
196- - name : runtime-volume
197- persistentVolumeClaim :
198- claimName : {{ $runtimeClaim }}
193+ {{- if $.Values.mountEpicsOpis | default true }}
199194 - name : opis-volume
200195 persistentVolumeClaim :
201- claimName : {{ $opisClaim }}
202- - name : autosave-volume
203- persistentVolumeClaim :
204- claimName : {{ $autosaveClaim }}
196+ # use the supplied claim name or default to one based on ioc_group
197+ claimName : {{ $.Values.opisClaimName | default $opisClaim }}
198+ {{- end }}
205199 - name : config-volume
206200 configMap :
207201 name : {{ .Release.Name }}-config
0 commit comments