diff --git a/Charts/dev-c7/templates/statefulset.yaml b/Charts/dev-c7/templates/statefulset.yaml index 1c4f214..9d51279 100644 --- a/Charts/dev-c7/templates/statefulset.yaml +++ b/Charts/dev-c7/templates/statefulset.yaml @@ -52,25 +52,29 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" command: {{- .Values.command | toYaml | nindent 12 }} + args: + {{- .Values.args | toYaml | nindent 12 }} stdin: true tty: true - {{- $iocLocation := (.Values.iocLocation | default $location) | upper }} + {{- $epicsDomain := (.Values.epicsDomain | default $location) | upper }} {{- $iocName := (.Values.iocName | default .Release.Name) | upper }} - {{ $workingDir := "" }} {{- /* create the variable in global scope before setting in if/else!!! */ -}} - {{- if .Values.iocPath }} - {{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }} - {{- else }} - {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $iocLocation $iocName .Values.iocVersion }} + {{- $workingDir := .Values.workingDir }} + {{- if eq $workingDir "" }} + {{- if .Values.iocPath }} + {{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }} + {{- else }} + {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $epicsDomain $iocName .Values.iocVersion }} + {{- end }} {{- end }} - workingDir: {{ $workingDir }} + workingDir: {{ .Values.workingDir | default $workingDir }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} env: - # psuedo home sets up epics module etc. - - name: HOME - value: /epicsHome + # psuedo home sets up epics module etc. + - name: HOME + value: /epicsHome imagePullPolicy: {{ .Values.image.pullPolicy }} {{- with .Values.livenessProbe }} livenessProbe: @@ -87,6 +91,9 @@ spec: {{- with .Values.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} + {{- with $.Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }} {{- with .Values.autosavePath }} - name: autosave @@ -102,6 +109,9 @@ spec: {{- with .Values.volumes }} volumes: {{- toYaml . | nindent 8 }} + {{- with $.Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- with .Values.autosavePath }} - name: autosave diff --git a/Charts/dev-c7/values.schema.json b/Charts/dev-c7/values.schema.json index 37c6e2a..7ed573e 100644 --- a/Charts/dev-c7/values.schema.json +++ b/Charts/dev-c7/values.schema.json @@ -8,6 +8,12 @@ "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/affinity.json", "type": "object" }, + "args": { + "type": "array", + "items": { + "type": "string" + } + }, "autosavePath": { "description": "Full path to an IOC instance's autosave folder. Overrides autosaveRootPath when not blank", "type": "string" @@ -22,10 +28,24 @@ "type": "string" } }, + "epicsDomain": { + "description": "IOCs DLS EPICS Domain (e.g. BL16I FE02J SR03C)", + "type": "string" + }, "epicsVersion": { "description": "the EPICS version, used to generate the /dls_sw/prod path to iocName", "type": "string" }, + "extraVolumeMounts": { + "description": "add extra mounts without overriding the default ones", + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/volumeMounts", + "type": "array" + }, + "extraVolumes": { + "description": "add extra volumes without overriding the default ones", + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/podspec.json#/properties/volumes", + "type": "array" + }, "fullnameOverride": { "type": "string" }, @@ -56,10 +76,6 @@ "imagePullSecrets": { "type": "array" }, - "iocLocation": { - "description": "the IOC location (e.g. BL16I FE02J SR03C)", - "type": "string" - }, "iocName": { "description": "the folder name for the compiled IOC, defaults to ucase of the services folder name", "type": "string" @@ -140,6 +156,10 @@ } } } + }, + "workingDir": { + "description": "override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion", + "type": "string" } }, "additionalProperties": false diff --git a/Charts/dev-c7/values.yaml b/Charts/dev-c7/values.yaml index 0493d9d..ccc925e 100644 --- a/Charts/dev-c7/values.yaml +++ b/Charts/dev-c7/values.yaml @@ -12,13 +12,14 @@ iocName: "" # @schema description: the IOC release, used to generate the /dls_sw/prod path to iocName iocVersion: "" -# @schema description: the IOC location (e.g. BL16I FE02J SR03C) -iocLocation: "" +# @schema description: IOCs DLS EPICS Domain (e.g. BL16I FE02J SR03C) +epicsDomain: "" # @schema description: the EPICS version, used to generate the /dls_sw/prod path to iocName epicsVersion: R3.14.12.7 - # @schema description: overrides the parent folder for iocName to any path in /dls_sw/work or /dls_sw/prod iocPath: "" +# @schema description: override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion +workingDir: "" # @schema description: shared values for all services # @schema additionalProperties: true @@ -36,6 +37,8 @@ image: command: - bash - -lc + +args: - stdio-expose ./bin/linux-x86_64/st*.sh # @schema description: enable host networking for the pod @@ -87,6 +90,11 @@ volumes: hostPath: path: /dls_sw/etc +# extraVolumes for the Deployment. +# @schema description: add extra volumes without overriding the default ones +# @schema $ref: $k8s/podspec.json#/properties/volumes +extraVolumes: [] + # volumeMounts for the Deployment. # @schema $ref: $k8s/container.json#/properties/volumeMounts volumeMounts: @@ -106,6 +114,11 @@ volumeMounts: mountPath: /dls_sw/etc readOnly: true +# extraVolumeMounts for the Deployment. +# @schema description: add extra mounts without overriding the default ones +# @schema $ref: $k8s/container.json#/properties/volumeMounts +extraVolumeMounts: [] + # @schema $ref: $k8s/podspec.json#/properties/tolerations tolerations: []