From 8bd79b353c22085372e98a1a6c94db2a53df70ad Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 11 Oct 2024 07:40:01 +0100 Subject: [PATCH] add arbitrary host mount list --- Charts/ioc-instance/templates/deployment.yaml | 12 ++++++ Charts/ioc-instance/values.yaml | 8 +++- Schemas/ioc-instance.schema.json | 39 ++++++++++++++++--- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/Charts/ioc-instance/templates/deployment.yaml b/Charts/ioc-instance/templates/deployment.yaml index e9dfd3d..e9d0cfd 100644 --- a/Charts/ioc-instance/templates/deployment.yaml +++ b/Charts/ioc-instance/templates/deployment.yaml @@ -69,6 +69,12 @@ spec: path: {{ .Values.dataVolume.hostPath }} type: Directory {{- end }} + {{- if .Values.hostMounts }} + {{- range .Values.hostMounts }} + - name: {{ .name }} + hostPath: {{ .hostPath }} + {{- end }} + {{- end }} - name: config-volume configMap: name: {{ .Release.Name }}-config @@ -114,6 +120,12 @@ spec: - name: autosave-volume mountPath: /autosave subPath: "{{ .Release.Name }}" + {{- if .Values.hostMounts }} + {{- range .Values.hostMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- end }} + {{- end }} stdin: true tty: true securityContext: diff --git a/Charts/ioc-instance/values.yaml b/Charts/ioc-instance/values.yaml index 1a603e8..1cd0efe 100644 --- a/Charts/ioc-instance/values.yaml +++ b/Charts/ioc-instance/values.yaml @@ -76,6 +76,9 @@ dataVolume: # inside/outside container paths. hostPath: /data +# additional host mounts if required +hostMounts: [] + # use the shared PVC for publishing opi files over http (see services/opis) opisClaim: "" # use the shared PVC for holding runtime files for each IOC @@ -98,7 +101,8 @@ affinity: # - bl01t # If specified, the pod's tolerations. -tolerations: [] +tolerations: + [] # - key: location # operator: Equal # value: bl01t @@ -111,4 +115,4 @@ resources: memory: 256Mi requests: cpu: 100m - memory: 64Mi \ No newline at end of file + memory: 64Mi diff --git a/Schemas/ioc-instance.schema.json b/Schemas/ioc-instance.schema.json index a981594..b9c045b 100644 --- a/Schemas/ioc-instance.schema.json +++ b/Schemas/ioc-instance.schema.json @@ -1,4 +1,5 @@ -{ "title": "Values", +{ + "title": "Values", "type": "object", "$schema": "http://json-schema.org/schema#", "$ref": "#/$defs/base", @@ -30,8 +31,12 @@ "affinity": { "description": "Affinity is a group of affinity scheduling rules.", "oneOf": [ - {"type": "null"}, - {"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/affinity"} + { + "type": "null" + }, + { + "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/affinity" + } ] }, "nodeName": { @@ -100,6 +105,26 @@ } } }, + "hostMounts": { + "type": "array", + "properties": { + "description": "Additional host volumes to mount into the container", + "items": { + "name": { + "type": "string", + "description": "volume name" + }, + "hostPath": { + "type": "string", + "description": "Path to mount on the host" + }, + "mountPath": { + "type": "string", + "description": "Path to mount in the container" + } + } + } + }, "opisClaim": { "type": "string", "description": "Use the shared PVC for publishing opi files over http (see services/opis)" @@ -115,8 +140,12 @@ "resources": { "description": "ResourceRequirements describes the compute resource requirements.", "oneOf": [ - {"type": "null"}, - {"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Container/properties/resources"} + { + "type": "null" + }, + { + "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Container/properties/resources" + } ] }, "tolerations": {