Skip to content

Commit 2df7d68

Browse files
committed
helm chart tweaks after initial tests
1 parent 0bfa650 commit 2df7d68

File tree

6 files changed

+162
-100
lines changed

6 files changed

+162
-100
lines changed

Charts/dev-c7/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ version: 0.1.0
1111

1212
# This is the version number of the application being deployed. It implies the
1313
# the version tag of the container image.
14-
appVersion: 2025.5.1
14+
appVersion: 2025.9.1-beta.2

Charts/dev-c7/templates/deployment.yaml

Lines changed: 0 additions & 83 deletions
This file was deleted.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{{- /*
2+
Default the derivable substitution values.
3+
4+
This keeps the length of the values.txt file for each individual IOC
5+
to a minimum
6+
*/ -}}
7+
{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}}
8+
{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}}
9+
{{- $image := .Values.image | required "ERROR - You must supply image." -}}
10+
11+
{{- $enabled := eq .Values.global.enabled false | ternary false true -}}
12+
13+
apiVersion: apps/v1
14+
kind: StatefulSet
15+
metadata:
16+
name: {{ .Release.Name }}
17+
labels:
18+
app: {{ .Release.Name }}
19+
location: {{ $location }}
20+
ioc_group: {{ $ioc_group }}
21+
enabled: {{ $enabled | quote }}
22+
is_ioc: "true"
23+
spec:
24+
replicas: {{ $enabled | ternary 1 0 }}
25+
selector:
26+
matchLabels:
27+
app: {{ .Release.Name }}
28+
template:
29+
metadata:
30+
{{- with .Values.podAnnotations }}
31+
annotations:
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
34+
labels:
35+
app: {{ .Release.Name }}
36+
location: {{ $location }}
37+
ioc_group: {{ $ioc_group }}
38+
is_ioc: "true"
39+
spec:
40+
hostNetwork: {{ .Values.hostNetwork }}
41+
{{- with .Values.imagePullSecrets }}
42+
imagePullSecrets:
43+
{{- toYaml . | nindent 8 }}
44+
{{- end }}
45+
terminationGracePeriodSeconds: 2
46+
{{- with .Values.podSecurityContext }}
47+
securityContext:
48+
{{- toYaml . | nindent 8 }}
49+
{{- end }}
50+
containers:
51+
- name: {{ .Chart.Name }}
52+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
53+
command:
54+
{{ .Values.command | toYaml | indent 12 }}
55+
stdin: true
56+
tty: true
57+
{{- $domain := (.Values.ioc_domain | default $location) | upper }}
58+
{{- $ioc_name := (.Values.ioc_name | default .Release.Name) | upper }}
59+
{{ $workingDir := "" }} {{- /* create the variable in global scope before setting in if/else!!! */ -}}
60+
{{- if .Values.ioc_path }}
61+
{{- $workingDir = printf "%s/%s" .Values.ioc_path $ioc_name }}
62+
{{- else }}
63+
{{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epics_version $domain $ioc_name .Values.ioc_version }}
64+
{{- end }}
65+
workingDir: {{ $workingDir }}
66+
{{- with .Values.securityContext }}
67+
securityContext:
68+
{{- toYaml . | nindent 12 }}
69+
{{- end }}
70+
env:
71+
# make sure that the $HOME path is writeable
72+
- name: HOME
73+
value: /tmp
74+
imagePullPolicy: {{ .Values.image.pullPolicy }}
75+
{{- with .Values.livenessProbe }}
76+
livenessProbe:
77+
{{- toYaml . | nindent 12 }}
78+
{{- end }}
79+
{{- with .Values.readinessProbe }}
80+
readinessProbe:
81+
{{- toYaml . | nindent 12 }}
82+
{{- end }}
83+
{{- with .Values.resources }}
84+
resources:
85+
{{- toYaml . | nindent 12 }}
86+
{{- end }}
87+
{{- with .Values.volumeMounts }}
88+
volumeMounts:
89+
{{- toYaml . | nindent 12 }}
90+
{{- end }}
91+
{{- with .Values.volumes }}
92+
volumes:
93+
{{- toYaml . | nindent 8 }}
94+
{{- end }}
95+
{{- with .Values.nodeSelector }}
96+
nodeSelector:
97+
{{- toYaml . | nindent 8 }}
98+
{{- end }}
99+
{{- with .Values.affinity }}
100+
affinity:
101+
{{- toYaml . | nindent 8 }}
102+
{{- end }}
103+
{{- with .Values.tolerations }}
104+
tolerations:
105+
{{- toYaml . | nindent 8 }}
106+
{{- end }}

Charts/dev-c7/values.schema.json

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/affinity.json",
99
"type": "object"
1010
},
11+
"command": {
12+
"type": "array",
13+
"items": {
14+
"type": "null"
15+
}
16+
},
17+
"epics_version": {
18+
"description": "the EPICS version, used to generate the /dls_sw/prod path to ioc_name",
19+
"type": "string"
20+
},
1121
"fullnameOverride": {
1222
"type": "string"
1323
},
@@ -38,6 +48,22 @@
3848
"imagePullSecrets": {
3949
"type": "array"
4050
},
51+
"ioc_domain": {
52+
"description": "the IOC domain (e.g. BL16I FE02J SR03C)",
53+
"type": "string"
54+
},
55+
"ioc_name": {
56+
"description": "the folder name for the compiled IOC, defaults to ucase of the services folder name",
57+
"type": "string"
58+
},
59+
"ioc_path": {
60+
"description": "overrides the parent folder for ioc_name to any path in /dls_sw/work or /dls_sw/prod",
61+
"type": "string"
62+
},
63+
"ioc_version": {
64+
"description": "the IOC release, used to generate the /dls_sw/prod path to ioc_name",
65+
"type": "string"
66+
},
4167
"nameOverride": {
4268
"type": "string"
4369
},
@@ -57,10 +83,6 @@
5783
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/podspec.json#/properties/securityContext",
5884
"type": "object"
5985
},
60-
"replicaCount": {
61-
"description": "Set to 0 to stop the IOC, 1 to run the IOC",
62-
"type": "integer"
63-
},
6486
"resources": {
6587
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/resources",
6688
"type": "object"
@@ -73,12 +95,6 @@
7395
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/podspec.json#/properties/tolerations",
7496
"type": "array"
7597
},
76-
"userId": {
77-
"type": "integer"
78-
},
79-
"userName": {
80-
"type": "string"
81-
},
8298
"volumeMounts": {
8399
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/volumeMounts",
84100
"type": "array",

Charts/dev-c7/values.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@
88
# With annotations for building the schema using:
99
# https://github.com/losisin/helm-values-schema-json.git
1010

11+
# @schema description: the folder name for the compiled IOC, defaults to ucase of the services folder name
12+
ioc_name: ""
13+
# @schema description: the IOC release, used to generate the /dls_sw/prod path to ioc_name
14+
ioc_version: ""
15+
# @schema description: the IOC domain (e.g. BL16I FE02J SR03C)
16+
ioc_domain: ""
17+
# @schema description: the EPICS version, used to generate the /dls_sw/prod path to ioc_name
18+
epics_version: R3.14.12.7
19+
20+
# @schema description: overrides the parent folder for ioc_name to any path in /dls_sw/work or /dls_sw/prod
21+
ioc_path: ""
22+
1123
# @schema description: shared values for all services
1224
# @schema additionalProperties: true
1325
global: {}
1426

15-
# @schema description: Set to 0 to stop the IOC, 1 to run the IOC
16-
replicaCount: 1
17-
1827
# @schema description: container image URI
1928
image:
2029
repository: ghcr.io/diamondlightsource/dev-c7
@@ -23,9 +32,11 @@ image:
2332
# Overrides the image tag whose default is the chart appVersion.
2433
tag: ""
2534

26-
# these must be filled
27-
userId: 1200288
28-
userName: hgv27681
35+
# @shema description: container entry point command
36+
command:
37+
- bash
38+
- -c
39+
-
2940

3041
# @schema description: enable host networking for the pod
3142
hostNetwork: false

schemas/dev-c7.service.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"dev-c7": {
6+
"$ref": "dev-c7.values.schema.json",
7+
"type": "object",
8+
"additionalProperties": false
9+
}
10+
},
11+
"additionalProperties": false
12+
}

0 commit comments

Comments
 (0)