From dc99ad5a3178cad73412f344fcdf35eaca9e88f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Malinowski?= <56644812+stan-dot@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:19:14 +0100 Subject: [PATCH] separate the init config in helm (#631) --- helm/blueapi/templates/init-configmap.yaml | 7 +++++++ helm/blueapi/templates/statefulset.yaml | 9 +++++++-- helm/blueapi/values.yaml | 20 +++++++++++--------- 3 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 helm/blueapi/templates/init-configmap.yaml diff --git a/helm/blueapi/templates/init-configmap.yaml b/helm/blueapi/templates/init-configmap.yaml new file mode 100644 index 000000000..90f2396ac --- /dev/null +++ b/helm/blueapi/templates/init-configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "blueapi.fullname" . }}-initconfig +data: + initconfig.yaml: |- + {{- toYaml .Values.initContainer.scratch | nindent 4 }} diff --git a/helm/blueapi/templates/statefulset.yaml b/helm/blueapi/templates/statefulset.yaml index e7847c73b..16246321d 100644 --- a/helm/blueapi/templates/statefulset.yaml +++ b/helm/blueapi/templates/statefulset.yaml @@ -35,6 +35,11 @@ spec: sources: - configMap: name: {{ include "blueapi.fullname" . }}-config + - name: init-config + projected: + sources: + - configMap: + name: {{ include "blueapi.fullname" . }}-initconfig {{- if .Values.scratchHostPath }} - name: scratch-host hostPath: @@ -55,12 +60,12 @@ spec: args: - | echo "Setting up scratch area" - blueapi -c /config/config.yaml setup-scratch + blueapi -c /config/initconfig.yaml setup-scratch if [ $? -ne 0 ]; then echo 'Blueapi failed'; exit 1; fi; echo "Exporting venv as artefact" cp -r /venv/* /artefacts volumeMounts: - - name: worker-config + - name: init-config mountPath: "/config" readOnly: true - name: scratch-host diff --git a/helm/blueapi/values.yaml b/helm/blueapi/values.yaml index b7a6220f3..4473907fd 100644 --- a/helm/blueapi/values.yaml +++ b/helm/blueapi/values.yaml @@ -80,7 +80,8 @@ listener: resources: {} # Additional envVars to mount to the pod as a String -extraEnvVars: [] +extraEnvVars: + [] # - name: RABBITMQ_PASSWORD # valueFrom: # secretKeyRef: @@ -108,13 +109,14 @@ worker: passcode: guest host: rabbitmq port: 61613 - # Uncomment this to enable the scratch directory - # scratch: - # root: /blueapi-plugins/scratch - # repositories: [] - # - name: "dodal" - # remote_url: https://github.com/DiamondLightSource/dodal.git - -# Mount path for scratch area from host machine, setting + +initContainer: + scratch: + root: /blueapi-plugins/scratch + repositories: [] + # - name: "dodal" + # remote_url: https://github.com/DiamondLightSource/dodal.git + +# Mount path for scratch area from host machine, setting # this effectively enables scratch area management scratchHostPath: "" # example: /usr/local/blueapi-software-scratch