From dcb5fbc526f87a5e8ff5d14a2d488bba93ef2b34 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Tue, 30 Jan 2024 16:35:25 +0000 Subject: [PATCH] restructure for nested helm charts --- .../{_ioc_helm => _helm/configmap}/Chart.yaml | 2 +- .../_helm/configmap/templates/configmap.yaml | 19 +++++++++++++++ services/_helm/ioc-instance/Chart.yaml | 13 +++++++++++ .../ioc-instance}/README.md | 0 .../ioc-instance}/values.yaml | 3 +-- services/_ioc_helm/templates/configmap.yaml | 23 ------------------- services/bl47p-ea-test-01/Chart.yaml | 13 ++++++----- services/bl47p-ea-test-01/_ioc_helm | 1 - services/bl47p-ea-test-01/helm | 1 + 9 files changed, 42 insertions(+), 33 deletions(-) rename services/{_ioc_helm => _helm/configmap}/Chart.yaml (84%) create mode 100644 services/_helm/configmap/templates/configmap.yaml create mode 100644 services/_helm/ioc-instance/Chart.yaml rename services/{_ioc_helm => _helm/ioc-instance}/README.md (100%) rename services/{_ioc_helm => _helm/ioc-instance}/values.yaml (96%) delete mode 100644 services/_ioc_helm/templates/configmap.yaml delete mode 120000 services/bl47p-ea-test-01/_ioc_helm create mode 120000 services/bl47p-ea-test-01/helm diff --git a/services/_ioc_helm/Chart.yaml b/services/_helm/configmap/Chart.yaml similarity index 84% rename from services/_ioc_helm/Chart.yaml rename to services/_helm/configmap/Chart.yaml index e3eb707..b173a6e 100644 --- a/services/_ioc_helm/Chart.yaml +++ b/services/_helm/configmap/Chart.yaml @@ -1,6 +1,6 @@ # A Helm Chart for adding arbitrary configuration to a service instance apiVersion: v2 -name: instance-config +name: configmap version: 1.0.0 diff --git a/services/_helm/configmap/templates/configmap.yaml b/services/_helm/configmap/templates/configmap.yaml new file mode 100644 index 0000000..d4fc713 --- /dev/null +++ b/services/_helm/configmap/templates/configmap.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.name }}-config + labels: + app: {{ .Release.name }} +data: + +{{- /* + add the contents of every file in the config folder of this IOC helm chart + into the config map - The files must be text only. + + Also add a version.txt file that contains the version of the IOC +*/ -}} + +{{ (.Files.Glob "../../config/*").AsConfig | indent 2 }} + version.txt: | + "IOC {{ .Release.Name }} version {{ .Release.Version }}"" diff --git a/services/_helm/ioc-instance/Chart.yaml b/services/_helm/ioc-instance/Chart.yaml new file mode 100644 index 0000000..758ddf8 --- /dev/null +++ b/services/_helm/ioc-instance/Chart.yaml @@ -0,0 +1,13 @@ +# A Helm Chart for deploying an IOC instance +apiVersion: v2 +name: ioc-instance-values + +version: 1.0.0 + +type: application + +dependencies: + - name: ioc-instance + version: "1.4.1" + # repository: "oci://ghcr.io/epics-containers" + repository: "file:///scratch/hgv27681/work/ec-helm-charts/Charts/ioc-instance" diff --git a/services/_ioc_helm/README.md b/services/_helm/ioc-instance/README.md similarity index 100% rename from services/_ioc_helm/README.md rename to services/_helm/ioc-instance/README.md diff --git a/services/_ioc_helm/values.yaml b/services/_helm/ioc-instance/values.yaml similarity index 96% rename from services/_ioc_helm/values.yaml rename to services/_helm/ioc-instance/values.yaml index cb857cd..ffd4f4e 100644 --- a/services/_ioc_helm/values.yaml +++ b/services/_helm/ioc-instance/values.yaml @@ -1,5 +1,4 @@ -# default values for all IOCs on bl38p -# see end of file for values that may be overridden per individual IOC +# default values for all IOCs on bl47p beamline beamline: bl47p # we use the default service account in the namespace so leave this out diff --git a/services/_ioc_helm/templates/configmap.yaml b/services/_ioc_helm/templates/configmap.yaml deleted file mode 100644 index 451629a..0000000 --- a/services/_ioc_helm/templates/configmap.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Values.ioc_name }} - labels: - app: {{ .Values.ioc_name }} - beamline: {{ .Values.beamline }} - ioc_version: {{ .Values.ioc_version | quote }} - is_ioc: "True" -data: - -{{- /* - add the contents of every file in the config folder of this IOC helm chart - into the config map - The files must be text only. - - Also add a version.txt file that contains the version of the IOC -*/ -}} - -{{ (.Files.Glob "../conig/*").AsConfig | indent 2 }} - version.txt: | - "IOC {{ .Values.ioc_name }} version {{ .Values.ioc_version }}"" - diff --git a/services/bl47p-ea-test-01/Chart.yaml b/services/bl47p-ea-test-01/Chart.yaml index 7c33527..1dc8878 100644 --- a/services/bl47p-ea-test-01/Chart.yaml +++ b/services/bl47p-ea-test-01/Chart.yaml @@ -8,10 +8,11 @@ version: 1.4.1 type: application dependencies: - - name: ioc-instance - version: "1.4.1" - # repository: "oci://ghcr.io/epics-containers" - repository: "file:///scratch/hgv27681/work/ec-helm-charts/Charts/ioc-instance" - - name: ioc-instance-config + - name: ioc-instance-values version: "1.0.0" - repository: file://_ioc_helm + repository: file://helm/ioc-instance + # - name: configmap + # version: "1.0.0" + # repository: file://helm/configmap + # import-values: + # - Release.Name diff --git a/services/bl47p-ea-test-01/_ioc_helm b/services/bl47p-ea-test-01/_ioc_helm deleted file mode 120000 index 2af6acf..0000000 --- a/services/bl47p-ea-test-01/_ioc_helm +++ /dev/null @@ -1 +0,0 @@ -../_ioc_helm/ \ No newline at end of file diff --git a/services/bl47p-ea-test-01/helm b/services/bl47p-ea-test-01/helm new file mode 120000 index 0000000..e924097 --- /dev/null +++ b/services/bl47p-ea-test-01/helm @@ -0,0 +1 @@ +../_helm \ No newline at end of file