Skip to content

Commit

Permalink
switch to beamline/location for all Charts
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Feb 9, 2024
1 parent 796946a commit dbd378a
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Charts/epics-opis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ description: |
type: application

version: 2.0.0+b1
version: 2.0.0+b3
49 changes: 34 additions & 15 deletions Charts/epics-opis/templates/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,43 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.domain }}-nginx-config
name: {{ .Release.Name }}-nginx-config
labels:
app: {{ .Values.domain }}-opis
beamline: {{ .Values.domain }}
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
data:
{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
version.txt: |
IOC {{ .Values.domain }} version {{ .Chart.AppVersion }}
IOC {{ .Release.Name }} version {{ .Chart.AppVersion }}
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: {{ .Values.domain }}-opis
name: {{ .Release.Name }}
labels:
app: {{ .Values.domain }}-opis
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Values.domain }}-opis
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Values.domain }}-opis
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
spec:
volumes:
- name: html-volume
persistentVolumeClaim:
claimName: {{ .Values.domain }}-opi-claim
claimName: {{ .Values.ioc_group }}-opi-claim
- name: config-volume
configMap:
name: {{ .Values.domain }}-nginx-config
name: {{ .Release.Name }}-nginx-config
containers:
- name: server
image: {{ .Values.image }}
Expand All @@ -60,16 +65,28 @@ spec:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
{{ if .Values.beamline -}}
- matchExpressions:
- key: beamline
operator: In
values:
- {{ .Values.domain }}
- {{ .Values.beamline }}
{{- else -}}
- matchExpressions:
- key: location
operator: In
values:
- {{ .Values.location }}
{{- end }}
{{- end }}
tolerations:
- key: beamline
operator: Equal
value: {{ .Values.domain }}
value: {{ .Values.beamline }}
effect: NoSchedule
- key: location
operator: Equal
value: {{ .Values.location }}
effect: NoSchedule
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8}}
Expand All @@ -79,9 +96,11 @@ spec:
kind: Service
apiVersion: v1
metadata:
name: {{ .Values.domain }}-opis
name: {{ .Release.Name }}
labels:
app: {{ .Values.domain }}-opis
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
spec:
type: LoadBalancer
ports:
Expand All @@ -91,4 +110,4 @@ spec:
targetPort: 8080
sessionAffinity: None
selector:
app: {{ .Values.domain }}-opis
app: {{ .Release.Name }}
5 changes: 4 additions & 1 deletion Charts/epics-opis/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# use nginx for publishing opi files over http
image: docker.io/nginxinc/nginx-unprivileged:stable-bullseye-perl
# this value must be overridden

# These are overridden per ioc_group repository
beamline:
location:
ioc_group:
2 changes: 1 addition & 1 deletion Charts/epics-pvcs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ description: |
type: application

version: 2.0.0+b1
version: 2.0.0+b3
21 changes: 12 additions & 9 deletions Charts/epics-pvcs/templates/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.domain }}-opi-claim
name: {{ .Values.ioc_group }}-opi-claim
labels:
app: {{ .Values.domain }}-opi
beamline: {{ .Values.domain }}
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
spec:
accessModes:
- ReadWriteMany
Expand All @@ -17,10 +18,11 @@ spec:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.domain }}-runtime-claim
name: {{ .Values.ioc_group }}-runtime-claim
labels:
app: {{ .Values.domain }}-runtime
beamline: {{ .Values.domain }}
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
spec:
accessModes:
- ReadWriteMany
Expand All @@ -32,10 +34,11 @@ spec:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.domain }}-autosave-claim
name: {{ .Values.ioc_group }}-autosave-claim
labels:
app: {{ .Values.domain }}-autosave
beamline: {{ .Values.domain }}
app: {{ .Release.Name }}
location: {{ .Values.location }}
ioc_group: {{ .Values.ioc_group }}
spec:
accessModes:
- ReadWriteMany
Expand Down
2 changes: 1 addition & 1 deletion Charts/ioc-instance/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
apiVersion: v2
name: ioc-instance

version: 2.0.0+b1
version: 2.0.0+b3

type: application
10 changes: 1 addition & 9 deletions Charts/ioc-instance/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Release.Name }}
{{ if .Values.beamline -}}
beamline: {{ .Values.beamline }}
{{- else -}}
location: {{ .Values.location }}
{{- end }}
ioc_group: {{ .Values.ioc_group }}
is_ioc: "true"
spec:
Expand All @@ -20,11 +16,7 @@ spec:
metadata:
labels:
app: {{ .Release.Name }}
{{ if .Values.beamline -}}
beamline: {{ .Values.beamline }}
{{- else -}}
location: {{ .Values.location }}
{{- end }}
ioc_group: {{ .Values.ioc_group }}
is_ioc: "true"
spec:
Expand Down Expand Up @@ -129,7 +121,7 @@ spec:
- name: IOC_PREFIX
value: {{ or .Values.prefix .Release.Name | quote }}
- name: IOC_LOCATION
location: {{ .Values.location | quote}}
value: {{ .Values.location | quote }}
- name: BEAMLINE
value: {{ .Values.beamline | quote }}
- name: IOC_GROUP
Expand Down

0 comments on commit dbd378a

Please sign in to comment.