Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add arbitrary host mount list #36

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions Charts/ioc-instance/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ spec:
path: {{ .Values.dataVolume.hostPath }}
type: Directory
{{- end }}
{{- range .Values.hostMounts }}
- name: {{ .name }}
hostPath:
path: {{ .hostPath }}
type: Directory
{{- end }}
{{- range .Values.pvClaims }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .claimName }}
{{- end }}
- name: config-volume
configMap:
name: {{ .Release.Name }}-config
Expand Down Expand Up @@ -117,8 +128,14 @@ spec:
- name: autosave-volume
mountPath: /autosave
subPath: "{{ .Release.Name }}"
{{- if .Values.volumeMounts }}
{{ toYaml .Values.volumeMounts | indent 8}}
{{- range .Values.hostMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- end }}
{{- range .Values.pvClaims }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath | default "/" }}
{{- end }}
stdin: true
tty: true
Expand Down
20 changes: 18 additions & 2 deletions Charts/ioc-instance/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ dataVolume:
# inside/outside container paths.
hostPath: /data

# additional host mounts if required
hostMounts: []
# e.g.
# - name: andorusb
# hostPath: /dev/andorusb
# mountPath: /dev/andorusb

# additoonal
pvClaims: []
# e.g.
# - name: nfsv2-tftp
# claimName: nfsv2-tftp
# mountPath: "ioc-group/ioc-name"
# subPath: "ioc-group/ioc-name"

# 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
Expand Down Expand Up @@ -112,7 +127,8 @@ affinity: {}
# - bl01t

# If specified, the pod's tolerations.
tolerations: []
tolerations:
[]
# - key: location
# operator: Equal
# value: bl01t
Expand All @@ -125,4 +141,4 @@ resources:
memory: 256Mi
requests:
cpu: 100m
memory: 64Mi
memory: 64Mi
58 changes: 46 additions & 12 deletions Schemas/ioc-instance.schema.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ "title": "Values",
{
"title": "Values",
"type": "object",
"$schema": "http://json-schema.org/schema#",
"$ref": "#/$defs/base",
Expand Down Expand Up @@ -33,6 +34,20 @@
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/hostNetwork",
"description": "Use host network for IOC - required for Channel Access to work outside of the cluster unless a ca-gateway is in use"
},
"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"
}
]
},
"nodeName": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/nodeName"
},
"iocFolder": {
"type": "string",
"description": "Root folder for ioc source/binaries inside generic IOC container",
Expand Down Expand Up @@ -90,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)"
Expand All @@ -102,17 +137,16 @@
"type": "string",
"description": "Use the shared PVC autosave files (exclude for no autosave)"
},
"volumes": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/volumes"
},
"volumeMounts": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Container/properties/volumeMounts"
},
"nodeName": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/nodeName"
},
"affinity": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/affinity"
"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"
}
]
},
"tolerations": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec/properties/tolerations"
Expand Down
Loading