Skip to content

Commit 605ad89

Browse files
committed
add an experimental helm chart for running legacy IOCs in cluster
1 parent e868f36 commit 605ad89

File tree

6 files changed

+285
-0
lines changed

6 files changed

+285
-0
lines changed

dls-k8s-c7/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

dls-k8s-c7/Chart.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v2
2+
name: dls-k8s-c7
3+
description: A Helm chart legacy DLS IOCs
4+
5+
type: application
6+
7+
# This is the chart version. This version number should be incremented each time you make changes
8+
# to the chart and its templates, including the app version.
9+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10+
version: 0.1.0
11+
12+
# This is the version number of the application being deployed. It implies the
13+
# the version tag of the container image.
14+
appVersion: 2025.5.1

dls-k8s-c7/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
A Helm Chart for deploying the dev-c7 container into a DLS Cluster.
2+
3+
Intended for runnhing legacy IOCs in a RHEL8 or higher DLS worker node.

dls-k8s-c7/templates/_helpers.tpl

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "dls-k8s-c7.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "dls-k8s-c7.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "dls-k8s-c7.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "dls-k8s-c7.labels" -}}
37+
helm.sh/chart: {{ include "dls-k8s-c7.chart" . }}
38+
{{ include "dls-k8s-c7.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "dls-k8s-c7.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "dls-k8s-c7.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "dls-k8s-c7.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "dls-k8s-c7.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "dls-k8s-c7.fullname" . }}
5+
labels:
6+
{{- include "dls-k8s-c7.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "dls-k8s-c7.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
{{- with .Values.podAnnotations }}
15+
annotations:
16+
{{- toYaml . | nindent 8 }}
17+
{{- end }}
18+
labels:
19+
{{- include "dls-k8s-c7.labels" . | nindent 8 }}
20+
{{- with .Values.podLabels }}
21+
{{- toYaml . | nindent 8 }}
22+
{{- end }}
23+
spec:
24+
hostNetwork: {{ .Values.hostNetwork }}
25+
{{- with .Values.imagePullSecrets }}
26+
imagePullSecrets:
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
securityContext:
30+
runAsNonRoot: true
31+
runAsUser: {{ .Values.userId }}
32+
runAsGroup: {{ .Values.groupId | default .Values.userId }}
33+
containers:
34+
- name: {{ .Chart.Name }}
35+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
36+
command:
37+
- bash
38+
args:
39+
- "-c"
40+
- "sleep infinity"
41+
workingDir: /dls_sw/prod/R3.14.12.7/ioc/BL16I/BL16I-MO-IOC-12/21-2
42+
env:
43+
- name: HOME
44+
value: /home/{{ .Values.userName }}
45+
- name: USER
46+
value: {{ .Values.userName }}
47+
imagePullPolicy: {{ .Values.image.pullPolicy }}
48+
{{- with .Values.livenessProbe }}
49+
livenessProbe:
50+
{{- toYaml . | nindent 12 }}
51+
{{- end }}
52+
{{- with .Values.readinessProbe }}
53+
readinessProbe:
54+
{{- toYaml . | nindent 12 }}
55+
{{- end }}
56+
{{- with .Values.resources }}
57+
resources:
58+
{{- toYaml . | nindent 12 }}
59+
{{- end }}
60+
{{- with .Values.volumeMounts }}
61+
volumeMounts:
62+
{{- toYaml . | nindent 12 }}
63+
{{- end }}
64+
{{- with .Values.volumes }}
65+
volumes:
66+
{{- toYaml . | nindent 8 }}
67+
{{- end }}
68+
{{- with .Values.nodeSelector }}
69+
nodeSelector:
70+
{{- toYaml . | nindent 8 }}
71+
{{- end }}
72+
{{- with .Values.affinity }}
73+
affinity:
74+
{{- toYaml . | nindent 8 }}
75+
{{- end }}
76+
{{- with .Values.tolerations }}
77+
tolerations:
78+
{{- toYaml . | nindent 8 }}
79+
{{- end }}

dls-k8s-c7/values.yaml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Default values for dls-k8s-c7.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
6+
replicaCount: 1
7+
8+
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
9+
image:
10+
repository: ghcr.io/diamondlightsource/dev-c7
11+
# This sets the pull policy for images.
12+
pullPolicy: IfNotPresent
13+
# Overrides the image tag whose default is the chart appVersion.
14+
tag: ""
15+
16+
# these must be filled
17+
userId: 1200288
18+
userName: hgv27681
19+
20+
# set to true for Channel access to be served on the locl subnet.
21+
hostNetwork: false
22+
23+
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
24+
imagePullSecrets: []
25+
# This is to override the chart name.
26+
nameOverride: ""
27+
fullnameOverride: ""
28+
29+
# This is for setting Kubernetes Annotations to a Pod.
30+
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
31+
podAnnotations: {}
32+
# This is for setting Kubernetes Labels to a Pod.
33+
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
34+
podLabels: {}
35+
36+
podSecurityContext:
37+
{}
38+
# fsGroup: 2000
39+
40+
resources:
41+
{}
42+
# We usually recommend not to specify default resources and to leave this as a conscious
43+
# choice for the user. This also increases chances charts run on environments with little
44+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
45+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
46+
# limits:
47+
# cpu: 100m
48+
# memory: 128Mi
49+
# requests:
50+
# cpu: 100m
51+
# memory: 128Mi
52+
53+
# volumes for the Deployment.
54+
volumes:
55+
- name: work
56+
hostPath:
57+
path: /dls_sw/work
58+
- name: prod
59+
hostPath:
60+
path: /dls_sw/prod
61+
- name: epics
62+
hostPath:
63+
path: /dls_sw/epics
64+
- name: apps
65+
hostPath:
66+
path: /dls_sw/apps
67+
- name: targetos
68+
hostPath:
69+
path: /dls_sw/targetOS
70+
- name: etc
71+
hostPath:
72+
path: /dls_sw/etc
73+
- name: home
74+
hostPath:
75+
path: /home/hgv27681
76+
77+
# volumeMounts for the Deployment.
78+
volumeMounts:
79+
- name: work
80+
mountPath: /dls_sw/work
81+
readOnly: true
82+
- name: prod
83+
mountPath: /dls_sw/prod
84+
readOnly: true
85+
- name: epics
86+
mountPath: /dls_sw/epics
87+
readOnly: true
88+
- name: apps
89+
mountPath: /dls_sw/apps
90+
readOnly: true
91+
- name: targetos
92+
mountPath: /dls_sw/targetOS
93+
readOnly: true
94+
- name: etc
95+
mountPath: /dls_sw/etc
96+
readOnly: true
97+
- name: home
98+
mountPath: /home/hgv27681
99+
100+
nodeSelector: {}
101+
102+
tolerations: []
103+
104+
affinity: {}

0 commit comments

Comments
 (0)