From 6f7ba31e9cf4bd357f355942c48e547fe641d090 Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Mon, 19 Aug 2024 14:42:41 +0100 Subject: [PATCH 1/7] Use globals for opis --- Charts/epics-opis/templates/deploy.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Charts/epics-opis/templates/deploy.yaml b/Charts/epics-opis/templates/deploy.yaml index ccd7af2..b755735 100644 --- a/Charts/epics-opis/templates/deploy.yaml +++ b/Charts/epics-opis/templates/deploy.yaml @@ -1,11 +1,15 @@ +{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} +{{- $ioc_group := .Values.global.ioc_group | required "ERROR - You must supply global.ioc_group" -}} +{{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} + kind: Deployment apiVersion: apps/v1 metadata: name: {{ .Release.Name }} labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} spec: replicas: 1 selector: @@ -15,8 +19,8 @@ spec: metadata: labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} annotations: {{ if and .Values.global .Values.global.files -}} {{- range $k, $v := .Values.global.files }} @@ -27,7 +31,7 @@ spec: volumes: - name: html-volume persistentVolumeClaim: - claimName: {{ .Values.ioc_group }}-opi-claim + claimName: {{ $opisClaim }} - name: config-volume configMap: name: {{ .Release.Name }}-nginx-config @@ -68,8 +72,8 @@ metadata: name: {{ .Release.Name }} labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} spec: type: LoadBalancer ports: From b6568ad9bf087be5319b9b3bc14ed0452de6b6cd Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Mon, 19 Aug 2024 14:42:59 +0100 Subject: [PATCH 2/7] Use globals for epics-pvcs --- Charts/epics-pvcs/templates/deploy.yaml | 32 +++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Charts/epics-pvcs/templates/deploy.yaml b/Charts/epics-pvcs/templates/deploy.yaml index f183779..2c98033 100644 --- a/Charts/epics-pvcs/templates/deploy.yaml +++ b/Charts/epics-pvcs/templates/deploy.yaml @@ -1,12 +1,20 @@ # PVC for shared OPI files + +{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} +{{- $ioc_group := .Values.global.ioc_group | required "ERROR - You must supply global.ioc_group" -}} +{{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} +{{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}} +{{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} +{{- $binariesClaim := default (print $ioc_group "-binaries-claim") .Values.binariesClaim -}} + kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ .Values.ioc_group }}-opi-claim + name: {{ $opisClaim }} labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} spec: accessModes: - ReadWriteMany @@ -18,11 +26,11 @@ spec: kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ .Values.ioc_group }}-runtime-claim + name: {{ $runtimeClaim }} labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} spec: accessModes: - ReadWriteMany @@ -34,11 +42,11 @@ spec: kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ .Values.ioc_group }}-autosave-claim + name: {{ $autosaveClaim }} labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} spec: accessModes: - ReadWriteMany @@ -51,11 +59,11 @@ spec: kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ .Values.ioc_group }}-binaries-claim + name: {{ $binariesClaim }} labels: app: {{ .Release.Name }} - location: {{ .Values.location }} - ioc_group: {{ .Values.ioc_group }} + location: {{ $location }} + ioc_group: {{ $ioc_group }} spec: accessModes: - ReadWriteMany From 7d50cc13b0e9969c6cb233639602949510711d53 Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Mon, 19 Aug 2024 14:44:50 +0100 Subject: [PATCH 3/7] Work on IOC-Instance globals --- Charts/ioc-instance/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Charts/ioc-instance/templates/deployment.yaml b/Charts/ioc-instance/templates/deployment.yaml index e5e2e5a..bafa829 100644 --- a/Charts/ioc-instance/templates/deployment.yaml +++ b/Charts/ioc-instance/templates/deployment.yaml @@ -4,8 +4,8 @@ Default the derivable substitution values. This keeps the length of the values.txt file for each individual IOC to a minimum */ -}} -{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location." -}} -{{- $ioc_group := default .Values.ioc_group $location -}} +{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} +{{- $ioc_group := .Values.global.ioc_group | required "ERROR - You must supply global.ioc_group" -}} {{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} {{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}} {{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} From 4f093e2e090dc65e9e9303778c307cbe947f948e Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Tue, 20 Aug 2024 14:07:32 +0100 Subject: [PATCH 4/7] Allow local ioc_group definition --- Charts/epics-opis/templates/deploy.yaml | 2 +- Charts/epics-pvcs/templates/deploy.yaml | 2 +- Charts/ioc-instance/templates/deployment.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Charts/epics-opis/templates/deploy.yaml b/Charts/epics-opis/templates/deploy.yaml index b755735..e284529 100644 --- a/Charts/epics-opis/templates/deploy.yaml +++ b/Charts/epics-opis/templates/deploy.yaml @@ -1,5 +1,5 @@ {{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} -{{- $ioc_group := .Values.global.ioc_group | required "ERROR - You must supply global.ioc_group" -}} +{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} {{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} kind: Deployment diff --git a/Charts/epics-pvcs/templates/deploy.yaml b/Charts/epics-pvcs/templates/deploy.yaml index 2c98033..884617f 100644 --- a/Charts/epics-pvcs/templates/deploy.yaml +++ b/Charts/epics-pvcs/templates/deploy.yaml @@ -1,7 +1,7 @@ # PVC for shared OPI files {{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} -{{- $ioc_group := .Values.global.ioc_group | required "ERROR - You must supply global.ioc_group" -}} +{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} {{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} {{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}} {{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} diff --git a/Charts/ioc-instance/templates/deployment.yaml b/Charts/ioc-instance/templates/deployment.yaml index bafa829..fc7ae5c 100644 --- a/Charts/ioc-instance/templates/deployment.yaml +++ b/Charts/ioc-instance/templates/deployment.yaml @@ -5,7 +5,7 @@ This keeps the length of the values.txt file for each individual IOC to a minimum */ -}} {{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} -{{- $ioc_group := .Values.global.ioc_group | required "ERROR - You must supply global.ioc_group" -}} +{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} {{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} {{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}} {{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} From ac1dae244aa8b74e33c5a4bf32897616b8f8ebe7 Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Tue, 20 Aug 2024 14:08:11 +0100 Subject: [PATCH 5/7] Reflect ioc_group schema with uptodate meaning --- Schemas/ioc-instance.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Schemas/ioc-instance.schema.json b/Schemas/ioc-instance.schema.json index 2f7f5ae..a981594 100644 --- a/Schemas/ioc-instance.schema.json +++ b/Schemas/ioc-instance.schema.json @@ -17,7 +17,7 @@ }, "ioc_group": { "type": "string", - "description": "The name of the repository in which the IOC is grouped", + "description": "Short name for this collection of services", "default": "" }, "serviceAccountName": { From d759679c073601d339deef4066efb1007fe66242 Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Tue, 20 Aug 2024 16:33:59 +0100 Subject: [PATCH 6/7] Update opis, pvcs values --- Charts/epics-opis/values.yaml | 5 ++--- Charts/epics-pvcs/values.yaml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Charts/epics-opis/values.yaml b/Charts/epics-opis/values.yaml index 09030ab..a660b90 100644 --- a/Charts/epics-opis/values.yaml +++ b/Charts/epics-opis/values.yaml @@ -1,7 +1,6 @@ # use nginx for publishing opi files over http image: nginx:1.25.4 - -# the name of the repository in which the IOC is grouped +# Short name for this collection of services ioc_group: -# the location where the IOCs will run +# location where these IOCs and services will run location: \ No newline at end of file diff --git a/Charts/epics-pvcs/values.yaml b/Charts/epics-pvcs/values.yaml index 59f9f2d..9556577 100644 --- a/Charts/epics-pvcs/values.yaml +++ b/Charts/epics-pvcs/values.yaml @@ -1,8 +1,7 @@ -# the name of the repository in which the IOC is grouped +# Short name for this collection of services ioc_group: -# the location where the IOCs will run +# location where these IOCs and services will run location: - # sizes of the auto provisioned PVs opi_size: 1Gi runtime_size: 1Gi From 0cda4dd5db10c3039add4e11dfd0b443e02c926e Mon Sep 17 00:00:00 2001 From: Marcell Nagy Date: Tue, 20 Aug 2024 16:52:44 +0100 Subject: [PATCH 7/7] Fix comment which causes error --- Charts/epics-pvcs/templates/deploy.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Charts/epics-pvcs/templates/deploy.yaml b/Charts/epics-pvcs/templates/deploy.yaml index 884617f..0b359b1 100644 --- a/Charts/epics-pvcs/templates/deploy.yaml +++ b/Charts/epics-pvcs/templates/deploy.yaml @@ -1,5 +1,3 @@ -# PVC for shared OPI files - {{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} {{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} {{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} @@ -7,6 +5,7 @@ {{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} {{- $binariesClaim := default (print $ioc_group "-binaries-claim") .Values.binariesClaim -}} +# PVC for shared OPI files kind: PersistentVolumeClaim apiVersion: v1 metadata: