From aea46b652f0ef39657e9c65c6c978e6329d1279f Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 28 Nov 2025 13:00:07 +0100 Subject: [PATCH 1/6] Update Helm Chart --- deployment/Chart.yaml | 19 ++--------------- deployment/templates/NOTES.txt | 11 ++++++++++ .../cloud-registry-configmap-job.yaml | 3 +-- .../templates/cloud-registry-deploy.yaml | 1 - .../templates/cloud-registry-route.yaml | 2 -- .../templates/cloud-registry-service.yaml | 2 -- deployment/templates/mongo-deploy.yaml | 9 ++++++-- deployment/templates/mongo-init-script.yaml | 21 +++++++++++++++++++ deployment/templates/mongo-pvc.yaml | 1 - deployment/templates/mongo-service.yaml | 2 -- deployment/values.yaml | 21 ++++++++++++++++--- 11 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 deployment/templates/NOTES.txt create mode 100644 deployment/templates/mongo-init-script.yaml diff --git a/deployment/Chart.yaml b/deployment/Chart.yaml index 5cb39a5..b099360 100644 --- a/deployment/Chart.yaml +++ b/deployment/Chart.yaml @@ -1,21 +1,6 @@ apiVersion: v2 name: cloud-registry description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. -appVersion: 1.16.0 +version: 2.0.0 +appVersion: 2.0.0 diff --git a/deployment/templates/NOTES.txt b/deployment/templates/NOTES.txt new file mode 100644 index 0000000..952aeb5 --- /dev/null +++ b/deployment/templates/NOTES.txt @@ -0,0 +1,11 @@ +Elixir Cloud Service Registry is being deployed! + +Once deployed: + + 1. Access the API via https://{{ .Values.host_name }}/ga4gh/registry/v1/ + + To test the connection, you can run: + + curl -X GET "https://{{ .Values.host_name }}/ga4gh/registry/v1/service-info" -H "Accept: application/json" -H "Authorization: Bearer {TOKEN}" + + 2. Access the Swagger UI via https://{{ .Values.host_name }}/ga4gh/registry/v1/ui diff --git a/deployment/templates/cloud-registry-configmap-job.yaml b/deployment/templates/cloud-registry-configmap-job.yaml index 8024999..f707332 100644 --- a/deployment/templates/cloud-registry-configmap-job.yaml +++ b/deployment/templates/cloud-registry-configmap-job.yaml @@ -29,10 +29,9 @@ spec: - name: HOST_NAME value: {{ .Values.host_name }} - name: MONGO_HOST - value: mongodb-{{ .Values.cloud-registry.appName }} + value: mongodb restartPolicy: Never serviceAccountName: {{ .Values.cloud_registry.appName }}-configurer -status: {} --- apiVersion: v1 kind: ServiceAccount diff --git a/deployment/templates/cloud-registry-deploy.yaml b/deployment/templates/cloud-registry-deploy.yaml index bfbf2b6..78189ce 100644 --- a/deployment/templates/cloud-registry-deploy.yaml +++ b/deployment/templates/cloud-registry-deploy.yaml @@ -47,4 +47,3 @@ spec: path: config.yaml name: app-config name: config-yaml -status: diff --git a/deployment/templates/cloud-registry-route.yaml b/deployment/templates/cloud-registry-route.yaml index 8f40efb..c6ddea4 100644 --- a/deployment/templates/cloud-registry-route.yaml +++ b/deployment/templates/cloud-registry-route.yaml @@ -15,6 +15,4 @@ spec: name: {{ .Values.cloud_registry.appName }} weight: 100 wildcardPolicy: None -status: - ingress: [] {{ end }} diff --git a/deployment/templates/cloud-registry-service.yaml b/deployment/templates/cloud-registry-service.yaml index 3bce2f2..9daaec9 100644 --- a/deployment/templates/cloud-registry-service.yaml +++ b/deployment/templates/cloud-registry-service.yaml @@ -12,5 +12,3 @@ spec: app: {{ .Values.cloud_registry.appName }} sessionAffinity: None type: ClusterIP -status: - loadBalancer: {} diff --git a/deployment/templates/mongo-deploy.yaml b/deployment/templates/mongo-deploy.yaml index a4afc80..36f9673 100644 --- a/deployment/templates/mongo-deploy.yaml +++ b/deployment/templates/mongo-deploy.yaml @@ -27,12 +27,15 @@ spec: ports: - containerPort: 27017 protocol: TCP - resources: {} + resources: {{- toYaml .Values.mongodb.resources | nindent 10 }} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /data/db/ name: mongodb + - name: init-script + mountPath: /docker-entrypoint-initdb.d/init-script.js + subPath: init-script.js dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler @@ -42,4 +45,6 @@ spec: - name: mongodb persistentVolumeClaim: claimName: mongodb -status: + - name: init-script + configMap: + name: mongo-init-script diff --git a/deployment/templates/mongo-init-script.yaml b/deployment/templates/mongo-init-script.yaml new file mode 100644 index 0000000..2b56115 --- /dev/null +++ b/deployment/templates/mongo-init-script.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: mongo-init-script +data: + init-script.js: | + db = db.getSiblingDB('serviceStore'); + + // Create the 'services' and 'service_info' collections + // Database configuration from https://github.com/elixir-cloud-aai/cloud-registry/blob/fa8a1b0dd1361751574550116150a630035dc199/cloud_registry/config.yaml#L32 + db.createCollection('services'); + db.tools.createIndex( + { id: 1 }, + { unique: true } + ); + db.createCollection('service_info'); + db.service_info.createIndex( + { id: 1 }, + { unique: true } + ); + diff --git a/deployment/templates/mongo-pvc.yaml b/deployment/templates/mongo-pvc.yaml index ef8989d..5b51178 100644 --- a/deployment/templates/mongo-pvc.yaml +++ b/deployment/templates/mongo-pvc.yaml @@ -8,4 +8,3 @@ spec: resources: requests: storage: {{ .Values.mongodb.volumeSize }} -status: diff --git a/deployment/templates/mongo-service.yaml b/deployment/templates/mongo-service.yaml index 22959a9..1c407a4 100644 --- a/deployment/templates/mongo-service.yaml +++ b/deployment/templates/mongo-service.yaml @@ -14,5 +14,3 @@ spec: app: mongodb sessionAffinity: None type: ClusterIP -status: - loadBalancer: {} diff --git a/deployment/values.yaml b/deployment/values.yaml index 06c8e11..5b23202 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -2,14 +2,29 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -host_name: cloud-registry.rahtiapp.fi +host_name: "" cloud_registry: - image: elixircloud/cloud-registry:0.1.0 + image: elixircloud/cloud-registry:latest appName: cloud-registry + resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi apiServer: kubernetes.default.svc:443 # address of k8s API server mongodb: - image: mongo:3.6 + image: docker.io/library/mongo:noble volumeSize: 1Gi + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 200m + memory: 512Mi + From e4a47487861e9d46e91aab04d0360e8b626a8628 Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 28 Nov 2025 13:05:51 +0100 Subject: [PATCH 2/6] Fix image --- deployment/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/values.yaml b/deployment/values.yaml index 5b23202..c41af80 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -2,10 +2,10 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -host_name: "" +host_name: "tristan-registry.rahtiapp.fi" cloud_registry: - image: elixircloud/cloud-registry:latest + image: elixircloud/cloud-registry:20240716 appName: cloud-registry resources: limits: From ca831fdcccc8dbf170ab3f6c8207731559b5e044 Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 28 Nov 2025 13:06:57 +0100 Subject: [PATCH 3/6] Fix --- deployment/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/values.yaml b/deployment/values.yaml index c41af80..bf80a5f 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -2,7 +2,7 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -host_name: "tristan-registry.rahtiapp.fi" +host_name: "" cloud_registry: image: elixircloud/cloud-registry:20240716 From 65982befc30d9757c70042a8c2b0ad68678e6567 Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 28 Nov 2025 15:19:14 +0100 Subject: [PATCH 4/6] Add Ingress. Edit Route and Values --- .../templates/cloud-registry-ingress.yaml | 29 +++++++++++++++++++ .../templates/cloud-registry-route.yaml | 2 +- deployment/values.yaml | 6 ++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 deployment/templates/cloud-registry-ingress.yaml diff --git a/deployment/templates/cloud-registry-ingress.yaml b/deployment/templates/cloud-registry-ingress.yaml new file mode 100644 index 0000000..0b71862 --- /dev/null +++ b/deployment/templates/cloud-registry-ingress.yaml @@ -0,0 +1,29 @@ +{{ if .Values.cloud_registry.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + {{- if .Values.cloud_registry.ingress.https.enabled }} + cert-manager.io/cluster-issuer: {{ .Values.cloud_registry.ingress.https.issuer }} + kubernetes.io/tls-acme: "true" + {{- end }} + name: {{ .Values.cloud_registry.appName }} +spec: + rules: + - host: {{ .Values.host_name }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Values.cloud_registry.appName }} + port: + number: 8080 +{{- if .Values.cloud_registry.ingress.https.enabled }} + tls: + - hosts: + - {{ .Values.host_name }} + secretName: {{ .Values.cloud_registry.appName }}-ingress-secret +{{- end }} +{{ end }} diff --git a/deployment/templates/cloud-registry-route.yaml b/deployment/templates/cloud-registry-route.yaml index c6ddea4..c96361f 100644 --- a/deployment/templates/cloud-registry-route.yaml +++ b/deployment/templates/cloud-registry-route.yaml @@ -1,4 +1,4 @@ -{{ if .Capabilities.APIVersions.Has "route.openshift.io/v1" }} +{{ if (and (.Capabilities.APIVersions.Has "route.openshift.io/v1") (not .Values.cloud_registry.ingress.enabled)) }} apiVersion: route.openshift.io/v1 kind: Route metadata: diff --git a/deployment/values.yaml b/deployment/values.yaml index bf80a5f..36ee9b2 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -7,6 +7,12 @@ host_name: "" cloud_registry: image: elixircloud/cloud-registry:20240716 appName: cloud-registry + # if ingress.enabled: false, it will deploy an OpenShift Route (https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/network_apis/route-route-openshift-io-v1) + ingress: + enabled: true + https: + enabled: false + issuer: letsencrypt-prod resources: limits: cpu: 100m From 99e944be2fe35f8671e9066299a88ec6dd59855d Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 1 Dec 2025 08:32:08 +0100 Subject: [PATCH 5/6] Fix mongo init script --- deployment/templates/mongo-init-script.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/templates/mongo-init-script.yaml b/deployment/templates/mongo-init-script.yaml index 2b56115..72d66c8 100644 --- a/deployment/templates/mongo-init-script.yaml +++ b/deployment/templates/mongo-init-script.yaml @@ -9,7 +9,7 @@ data: // Create the 'services' and 'service_info' collections // Database configuration from https://github.com/elixir-cloud-aai/cloud-registry/blob/fa8a1b0dd1361751574550116150a630035dc199/cloud_registry/config.yaml#L32 db.createCollection('services'); - db.tools.createIndex( + db.services.createIndex( { id: 1 }, { unique: true } ); From b727da114a877d5f6d0ac29ae218f2d58607cfda Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 1 Dec 2025 14:52:45 +0100 Subject: [PATCH 6/6] Add resources in cloud-registry deployment --- deployment/templates/cloud-registry-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/templates/cloud-registry-deploy.yaml b/deployment/templates/cloud-registry-deploy.yaml index 78189ce..30d4c19 100644 --- a/deployment/templates/cloud-registry-deploy.yaml +++ b/deployment/templates/cloud-registry-deploy.yaml @@ -27,7 +27,7 @@ spec: ports: - containerPort: 8080 protocol: TCP - resources: {} + resources: {{- toYaml .Values.cloud_registry.resources | nindent 10 }} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: