From e0c48013b32d8665d9c1989c3a65d01ff7bfef1a Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 12 Sep 2025 08:35:52 +0100 Subject: [PATCH 1/8] add control of environment variables to the helm chart --- Charts/fastcs/extra.values.yaml | 8 +++++++ Charts/fastcs/templates/statefulset.yaml | 11 +++++++++ Charts/fastcs/values.schema.json | 30 ++++++++++++++++++++++++ Charts/fastcs/values.yaml | 6 +++++ 4 files changed, 55 insertions(+) diff --git a/Charts/fastcs/extra.values.yaml b/Charts/fastcs/extra.values.yaml index 49e115d11..73f1d5586 100644 --- a/Charts/fastcs/extra.values.yaml +++ b/Charts/fastcs/extra.values.yaml @@ -13,3 +13,11 @@ extraContainers: - command - arg1 - arg2 + +globalEnv: + - name: example + value: example + +iocEnv: + - name: example + value: example diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index 4a3170d96..ee6f3b72b 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -78,6 +78,17 @@ spec: - name: {{ .name }} image: {{ .image }} imagePullPolicy: {{ $.Values.image.pullPolicy }} + env: + - name: IPYTHONDIR + value: /tmp/.ipython + - name: TERM + value: xterm-256color + {{- with $.Values.globalEnv }} + {{- toYaml . | nindent 12}} + {{- end }} + {{- with $.Values.iocEnv }} + {{- toYaml . | nindent 12}} + {{- end }} {{- with $.Values.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/Charts/fastcs/values.schema.json b/Charts/fastcs/values.schema.json index 88c13160f..8e81e19ba 100644 --- a/Charts/fastcs/values.schema.json +++ b/Charts/fastcs/values.schema.json @@ -73,6 +73,21 @@ "type": "object", "additionalProperties": true }, + "globalEnv": { + "description": "Add environment to all IOCs", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "hostNetwork": { "description": "enable host networking for the pod", "type": "boolean" @@ -103,6 +118,21 @@ "description": "path to the location of config folder (defaults to be the same as C++ IOCs)", "type": "string" }, + "iocEnv": { + "description": "Add environment to individual IOCs", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, "livenessProbe": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/livenessProbe", "type": "object" diff --git a/Charts/fastcs/values.yaml b/Charts/fastcs/values.yaml index 9ade52dc4..c2e879417 100644 --- a/Charts/fastcs/values.yaml +++ b/Charts/fastcs/values.yaml @@ -12,6 +12,12 @@ # @schema additionalProperties: true global: {} +# @schema description: Add environment to all IOCs +globalEnv: [] + +# @schema description: Add environment to individual IOCs +iocEnv: [] + # @schema description: container image URI image: repository: "" From 6dded269e9415519241302fa7085c200f0f0eb3e Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 12 Sep 2025 11:22:39 +0100 Subject: [PATCH 2/8] add in runtime folder and HOME --- Charts/fastcs/templates/statefulset.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index ee6f3b72b..415573fb3 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -78,9 +78,11 @@ spec: - name: {{ .name }} image: {{ .image }} imagePullPolicy: {{ $.Values.image.pullPolicy }} + # a writeable place to have cwd and HOME + workingDir: /epics/runtime env: - - name: IPYTHONDIR - value: /tmp/.ipython + - name: HOME + value: /epics/runtime - name: TERM value: xterm-256color {{- with $.Values.globalEnv }} @@ -101,9 +103,15 @@ spec: {{- with $.Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + - name: runtime-volume + mountPath: /epics/runtime + subPath: "{{ .Release.Name }}" - name: opis-volume mountPath: /epics/opi - subPath: "{{ $.Release.Name }}" + subPath: "{{ .Release.Name }}" + - name: autosave-volume + mountPath: /autosave + subPath: "{{ .Release.Name }}" - name: config-volume mountPath: {{ $.Values.iocConfig }} {{- if $.Values.editable }} @@ -166,9 +174,15 @@ spec: {{- with .Values.volumes }} {{- toYaml . | nindent 8 }} {{- end }} + - name: runtime-volume + persistentVolumeClaim: + claimName: {{ $runtimeClaim }} - name: opis-volume persistentVolumeClaim: claimName: {{ $opisClaim }} + - name: autosave-volume + persistentVolumeClaim: + claimName: {{ $autosaveClaim }} - name: config-volume configMap: name: {{ .Release.Name }}-config From cf733c9c4a3bdc869a50e86b1bda8b08df96e8fd Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 12 Sep 2025 11:27:15 +0100 Subject: [PATCH 3/8] add in the runtime and autosave mounts --- Charts/fastcs/templates/statefulset.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index 415573fb3..b85c1d417 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -78,7 +78,7 @@ spec: - name: {{ .name }} image: {{ .image }} imagePullPolicy: {{ $.Values.image.pullPolicy }} - # a writeable place to have cwd and HOME + # a writeable place to have cwd workingDir: /epics/runtime env: - name: HOME @@ -105,13 +105,13 @@ spec: {{- end }} - name: runtime-volume mountPath: /epics/runtime - subPath: "{{ .Release.Name }}" + subPath: {{ $.Release.Name }} - name: opis-volume mountPath: /epics/opi - subPath: "{{ .Release.Name }}" + subPath: {{ $.Release.Name }} - name: autosave-volume mountPath: /autosave - subPath: "{{ .Release.Name }}" + subPath: {{ $.Release.Name }} - name: config-volume mountPath: {{ $.Values.iocConfig }} {{- if $.Values.editable }} @@ -157,9 +157,15 @@ spec: {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + - name: runtime-volume + mountPath: /epics/runtime + subPath: {{ .Release.Name }} - name: opis-volume mountPath: /epics/opi - subPath: "{{ .Release.Name }}" + subPath: {{ .Release.Name }} + - name: autosave-volume + mountPath: /autosave + subPath: {{ .Release.Name }} - name: config-volume mountPath: {{ .Values.iocConfig }} {{- if .Values.editable }} From 5a6fd94b982bc52a4167118486aca2f505cbdc93 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 12 Sep 2025 11:33:45 +0100 Subject: [PATCH 4/8] fix env and workingDir for main container --- Charts/fastcs/templates/statefulset.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index b85c1d417..971ebc9fc 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -122,6 +122,19 @@ spec: - name: {{ .Chart.Name }} image: '{{ .Values.image.repository }}{{ ternary "-debug" "" .Values.editable }}:{{ .Values.image.tag }}' {{- with .Values.securityContext }} + # a writeable place to have cwd + workingDir: /epics/runtime + env: + - name: HOME + value: /epics/runtime + - name: TERM + value: xterm-256color + {{- with $.Values.globalEnv }} + {{- toYaml . | nindent 12}} + {{- end }} + {{- with $.Values.iocEnv }} + {{- toYaml . | nindent 12}} + {{- end }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} From f4b0a48f0ee02a371e9e8c7707401fa42b26b65e Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 12 Sep 2025 12:11:52 +0100 Subject: [PATCH 5/8] Apply spelling suggestions from coPilot code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Charts/fastcs/templates/statefulset.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index 971ebc9fc..99a0a3d1e 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -78,7 +78,7 @@ spec: - name: {{ .name }} image: {{ .image }} imagePullPolicy: {{ $.Values.image.pullPolicy }} - # a writeable place to have cwd + # a writable place to have cwd workingDir: /epics/runtime env: - name: HOME @@ -122,7 +122,7 @@ spec: - name: {{ .Chart.Name }} image: '{{ .Values.image.repository }}{{ ternary "-debug" "" .Values.editable }}:{{ .Values.image.tag }}' {{- with .Values.securityContext }} - # a writeable place to have cwd + # a writable place to have cwd workingDir: /epics/runtime env: - name: HOME From 1752a8cfccdbfc11b62bea946f72c0adca0430f3 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 19 Sep 2025 07:49:54 +0100 Subject: [PATCH 6/8] genericize chart, removing references to EPICS, IOC and epics-containers --- Charts/README.md | 2 +- Charts/fastcs/templates/statefulset.yaml | 74 +++++++++++------------- Charts/fastcs/values.schema.json | 32 ++++++++-- Charts/fastcs/values.yaml | 24 +++++--- 4 files changed, 77 insertions(+), 55 deletions(-) diff --git a/Charts/README.md b/Charts/README.md index 8d08d850a..bb0ad9b64 100644 --- a/Charts/README.md +++ b/Charts/README.md @@ -59,7 +59,7 @@ These features will be accessed via `ec`. See https://github.com/epics-container This script will: -- Inspect the values of `editable` and `autostart` in the `values.yaml` file of the specified IOC (TODO: at present it uses the p47-services source code to do so but this should be determined from the cluster in future). +- Inspect the values of `editable` and `autostart` in the `values.yaml` file of the specified service (TODO: at present it uses the p47-services source code to do so but this should be determined from the cluster in future). - Port forward the debugpy port (5678) from the pod to localhost. - If editable is true, it will mount the PVC locally using pv-mounter and open VSCode to the /workspaces/xxx folder. - If autostart is false, it will exec into the container and launch debugpy to run the main program. diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index 99a0a3d1e..46623e125 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -4,24 +4,27 @@ Default the derivable substitution values. This keeps the length of the values.txt file for each individual IOC to a minimum */ -}} -{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} -{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} +{{- $location := default .Values.global.location .Values.location | default "" -}} +# for epics-containers services repos, ioc_group is set in services/values.yaml +{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | default "" -}} +# for epics-containers services repos, opisClaim is named after the ioc_group in services/values.yaml +# for non-epics-containers services repos, opisClaim should be set in the service values.yaml {{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} -{{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}} -{{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} {{- $image := .Values.image | required "ERROR - You must supply image." -}} -{{- $enabled := eq .Values.global.enabled false | ternary false true -}} +{{- $enabled := eq .Values.global.enabled false | ternary false true }} apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ .Release.Name }} labels: - location: {{ $location }} + location: {{ $location | quote }} + {{- with $ioc_group }} ioc_group: {{ $ioc_group }} + {{- end }} enabled: {{ $enabled | quote }} - is_ioc: "true" + is_ioc: {{ .Values.is_ioc | quote }} {{- include "fastcs.labels" . | nindent 4 }} spec: replicas: {{ $enabled | ternary 1 0 }} @@ -35,10 +38,12 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - location: {{ $location }} + location: {{ $location | quote }} + {{- with $ioc_group }} ioc_group: {{ $ioc_group }} + {{- end }} enabled: {{ $enabled | quote }} - is_ioc: "true" + is_ioc: {{ .Values.is_ioc | quote }} {{- include "fastcs.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} @@ -79,16 +84,16 @@ spec: image: {{ .image }} imagePullPolicy: {{ $.Values.image.pullPolicy }} # a writable place to have cwd - workingDir: /epics/runtime + workingDir: /tmp env: - name: HOME - value: /epics/runtime + value: /tmp - name: TERM value: xterm-256color - {{- with $.Values.globalEnv }} + {{- with $.Values.env }} {{- toYaml . | nindent 12}} {{- end }} - {{- with $.Values.iocEnv }} + {{- with $.Values.global.env }} {{- toYaml . | nindent 12}} {{- end }} {{- with $.Values.securityContext }} @@ -103,17 +108,13 @@ spec: {{- with $.Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} - - name: runtime-volume - mountPath: /epics/runtime - subPath: {{ $.Release.Name }} + {{- with $.Values.opisMountPoint }} - name: opis-volume - mountPath: /epics/opi - subPath: {{ $.Release.Name }} - - name: autosave-volume - mountPath: /autosave + mountPath: . subPath: {{ $.Release.Name }} + {{- end }} - name: config-volume - mountPath: {{ $.Values.iocConfig }} + mountPath: {{ $.Values.configFolder }} {{- if $.Values.editable }} - name: {{ $.Release.Name }}-develop mountPath: /dest @@ -123,16 +124,16 @@ spec: image: '{{ .Values.image.repository }}{{ ternary "-debug" "" .Values.editable }}:{{ .Values.image.tag }}' {{- with .Values.securityContext }} # a writable place to have cwd - workingDir: /epics/runtime + workingDir: /tmp env: - name: HOME - value: /epics/runtime + value: /tmp - name: TERM value: xterm-256color - {{- with $.Values.globalEnv }} + {{- with $.Values.env }} {{- toYaml . | nindent 12}} {{- end }} - {{- with $.Values.iocEnv }} + {{- with $.Values.global.env }} {{- toYaml . | nindent 12}} {{- end }} securityContext: @@ -170,17 +171,13 @@ spec: {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} - - name: runtime-volume - mountPath: /epics/runtime - subPath: {{ .Release.Name }} + {{- if $.Values.mountEpicsOpis | default true }} - name: opis-volume mountPath: /epics/opi - subPath: {{ .Release.Name }} - - name: autosave-volume - mountPath: /autosave - subPath: {{ .Release.Name }} + subPath: {{ $.Release.Name }} + {{- end }} - name: config-volume - mountPath: {{ .Values.iocConfig }} + mountPath: {{ .Values.configFolder }} {{- if .Values.editable }} - name: {{ .Release.Name }}-develop mountPath: /workspaces @@ -193,15 +190,12 @@ spec: {{- with .Values.volumes }} {{- toYaml . | nindent 8 }} {{- end }} - - name: runtime-volume - persistentVolumeClaim: - claimName: {{ $runtimeClaim }} + {{- if $.Values.mountEpicsOpis | default true }} - name: opis-volume persistentVolumeClaim: - claimName: {{ $opisClaim }} - - name: autosave-volume - persistentVolumeClaim: - claimName: {{ $autosaveClaim }} + # use the supplied claim name or default to one based on ioc_group + claimName: {{ $.Values.opisClaimName | default $opisClaim }} + {{- end }} - name: config-volume configMap: name: {{ .Release.Name }}-config diff --git a/Charts/fastcs/values.schema.json b/Charts/fastcs/values.schema.json index 8e81e19ba..c5666765e 100644 --- a/Charts/fastcs/values.schema.json +++ b/Charts/fastcs/values.schema.json @@ -34,6 +34,10 @@ "description": "command to run for the production container", "type": "array" }, + "configFolder": { + "description": "path to the location of config folder", + "type": "string" + }, "debugCommand": { "description": "command to run for the debugging (non- autostart) container", "type": "array", @@ -45,6 +49,10 @@ "description": "editable and autostart are used for debugging and development in-cluster", "type": "boolean" }, + "env": { + "description": "Add environment to individual services", + "type": "array" + }, "extraContainers": { "description": "Add arbitrary containers to the pod", "type": "array", @@ -71,10 +79,15 @@ "global": { "description": "shared values for all services", "type": "object", + "properties": { + "env": { + "description": "Add environment to all services", + "type": "array" + } + }, "additionalProperties": true }, "globalEnv": { - "description": "Add environment to all IOCs", "type": "array", "items": { "type": "object", @@ -114,12 +127,7 @@ "type": "string" } }, - "iocConfig": { - "description": "path to the location of config folder (defaults to be the same as C++ IOCs)", - "type": "string" - }, "iocEnv": { - "description": "Add environment to individual IOCs", "type": "array", "items": { "type": "object", @@ -133,6 +141,10 @@ } } }, + "is_ioc": { + "description": "set to true of IOCs in services repos", + "type": "boolean" + }, "livenessProbe": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/livenessProbe", "type": "object" @@ -141,6 +153,14 @@ "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/podspec.json#/properties/nodeSelector", "type": "object" }, + "opisClaim": { + "description": "name of the PVC to use to store opi files, leave blank for IOCs - will then default to ixx-epics-opis", + "type": "null" + }, + "opisMountPoint": { + "description": "where to mount the opis volume inside the container", + "type": "string" + }, "podAnnotations": { "description": "Add annotations to the pod", "type": "object" diff --git a/Charts/fastcs/values.yaml b/Charts/fastcs/values.yaml index c2e879417..17c82beec 100644 --- a/Charts/fastcs/values.yaml +++ b/Charts/fastcs/values.yaml @@ -10,13 +10,12 @@ # @schema description: shared values for all services # @schema additionalProperties: true -global: {} +global: + # @schema description: Add environment to all services + env: [] -# @schema description: Add environment to all IOCs -globalEnv: [] - -# @schema description: Add environment to individual IOCs -iocEnv: [] +# @schema description: Add environment to individual services +env: [] # @schema description: container image URI image: @@ -68,8 +67,17 @@ editable: false # true: entrypoint is command above autostart: true -# @schema description: path to the location of config folder (defaults to be the same as C++ IOCs) -iocConfig: /epics/ioc/config +# @schema description: path to the location of config folder +configFolder: /config + +# @schema description: name of the PVC to use to store opi files, leave blank for IOCs - will then default to ixx-epics-opis +opisClaim: + +# @schema description: where to mount the opis volume inside the container +opisMountPoint: /epics/opi + +# @schema description: set to true of IOCs in services repos +is_ioc: false # @schema description: service port for Channel Access ca_server_port: 5064 From 6464a7c89a3551b1f8e0064a984a64fdf271e909 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 19 Sep 2025 08:29:44 +0100 Subject: [PATCH 7/8] fix opi folder mounts --- Charts/fastcs/templates/statefulset.yaml | 11 +++++++---- Charts/fastcs/values.schema.json | 2 +- Charts/fastcs/values.yaml | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Charts/fastcs/templates/statefulset.yaml b/Charts/fastcs/templates/statefulset.yaml index 46623e125..98db632c5 100644 --- a/Charts/fastcs/templates/statefulset.yaml +++ b/Charts/fastcs/templates/statefulset.yaml @@ -110,7 +110,7 @@ spec: {{- end }} {{- with $.Values.opisMountPoint }} - name: opis-volume - mountPath: . + mountPath: {{ . }} subPath: {{ $.Release.Name }} {{- end }} - name: config-volume @@ -171,9 +171,9 @@ spec: {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} - {{- if $.Values.mountEpicsOpis | default true }} + {{- with $.Values.opisMountPoint }} - name: opis-volume - mountPath: /epics/opi + mountPath: {{ . }} subPath: {{ $.Release.Name }} {{- end }} - name: config-volume @@ -190,7 +190,10 @@ spec: {{- with .Values.volumes }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if $.Values.mountEpicsOpis | default true }} + # if a mount point has been specified, claim a PVC to mount + # the PVC name will be ixx-epics-opis for IOCs (created in $opisClaim above) + # the PVC name must be specified in values.yaml for non-IOC services + {{- if .Values.opisMountPoint | default false }} - name: opis-volume persistentVolumeClaim: # use the supplied claim name or default to one based on ioc_group diff --git a/Charts/fastcs/values.schema.json b/Charts/fastcs/values.schema.json index c5666765e..182247fd9 100644 --- a/Charts/fastcs/values.schema.json +++ b/Charts/fastcs/values.schema.json @@ -155,7 +155,7 @@ }, "opisClaim": { "description": "name of the PVC to use to store opi files, leave blank for IOCs - will then default to ixx-epics-opis", - "type": "null" + "type": "string" }, "opisMountPoint": { "description": "where to mount the opis volume inside the container", diff --git a/Charts/fastcs/values.yaml b/Charts/fastcs/values.yaml index 17c82beec..b4d597c6f 100644 --- a/Charts/fastcs/values.yaml +++ b/Charts/fastcs/values.yaml @@ -71,10 +71,10 @@ autostart: true configFolder: /config # @schema description: name of the PVC to use to store opi files, leave blank for IOCs - will then default to ixx-epics-opis -opisClaim: +opisClaim: "" # @schema description: where to mount the opis volume inside the container -opisMountPoint: /epics/opi +opisMountPoint: "" # @schema description: set to true of IOCs in services repos is_ioc: false From a1991c4483a8195da15a00e9b7608df9aec5833b Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 19 Sep 2025 08:45:47 +0100 Subject: [PATCH 8/8] remove ioc specifics from pvc.yaml --- Charts/fastcs/extra.values.yaml | 9 ++--- Charts/fastcs/templates/pvcs.yaml | 6 ++-- Charts/fastcs/templates/service.yaml | 4 ++- Charts/fastcs/values.schema.json | 54 +++++++++++++--------------- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/Charts/fastcs/extra.values.yaml b/Charts/fastcs/extra.values.yaml index 73f1d5586..44d13af6e 100644 --- a/Charts/fastcs/extra.values.yaml +++ b/Charts/fastcs/extra.values.yaml @@ -14,10 +14,11 @@ extraContainers: - arg1 - arg2 -globalEnv: - - name: example - value: example +global: + env: + - name: example + value: example -iocEnv: +env: - name: example value: example diff --git a/Charts/fastcs/templates/pvcs.yaml b/Charts/fastcs/templates/pvcs.yaml index 1a2ce3737..53b1ffc09 100644 --- a/Charts/fastcs/templates/pvcs.yaml +++ b/Charts/fastcs/templates/pvcs.yaml @@ -1,7 +1,7 @@ # PVC for debugging volume {{ if .Values.editable }} -{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} -{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} +{{- $location := default .Values.global.location .Values.location | default "" -}} +{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | default "" -}} kind: PersistentVolumeClaim apiVersion: v1 @@ -10,7 +10,9 @@ metadata: labels: app: {{ .Release.Name }} location: {{ $location }} + with: {{ $ioc_group }} ioc_group: {{ $ioc_group }} + {{- end }} spec: accessModes: - ReadWriteMany diff --git a/Charts/fastcs/templates/service.yaml b/Charts/fastcs/templates/service.yaml index 4073818fc..bce0effa6 100644 --- a/Charts/fastcs/templates/service.yaml +++ b/Charts/fastcs/templates/service.yaml @@ -6,8 +6,10 @@ metadata: {{- include "fastcs.labels" . | nindent 4 }} app: {{ .Release.Name }} location: {{ .Values.global.location }} + {{- with .Values.global.ioc_group }} ioc_group: {{ .Values.global.ioc_group }} - is_ioc: "true" + {{- end }} + is_ioc: {{ .Values.is_ioc | quote }} spec: selector: app: {{ .Release.Name }} diff --git a/Charts/fastcs/values.schema.json b/Charts/fastcs/values.schema.json index 182247fd9..3abb884bf 100644 --- a/Charts/fastcs/values.schema.json +++ b/Charts/fastcs/values.schema.json @@ -51,7 +51,18 @@ }, "env": { "description": "Add environment to individual services", - "type": "array" + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } }, "extraContainers": { "description": "Add arbitrary containers to the pod", @@ -82,25 +93,22 @@ "properties": { "env": { "description": "Add environment to all services", - "type": "array" + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } } }, "additionalProperties": true }, - "globalEnv": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - } - }, "hostNetwork": { "description": "enable host networking for the pod", "type": "boolean" @@ -127,20 +135,6 @@ "type": "string" } }, - "iocEnv": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - } - }, "is_ioc": { "description": "set to true of IOCs in services repos", "type": "boolean"