diff --git a/.secrets.baseline b/.secrets.baseline index 1404f92d8..3d30075d0 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -423,29 +423,6 @@ "line_number": 13 } ], - "helm/gen3-user-data-library/README.md": [ - { - "type": "Secret Keyword", - "filename": "helm/gen3-user-data-library/README.md", - "hashed_secret": "4f2a84424eb908cfbe25c1e486024ae59b5a6085", - "is_verified": false, - "line_number": 28 - }, - { - "type": "Secret Keyword", - "filename": "helm/gen3-user-data-library/README.md", - "hashed_secret": "d84ce25b0f9bc2cc263006ae39453efb22cc2900", - "is_verified": false, - "line_number": 45 - }, - { - "type": "Secret Keyword", - "filename": "helm/gen3-user-data-library/README.md", - "hashed_secret": "f09dd6e359833a12f48c4c4255d6e87a6e55cfe9", - "is_verified": false, - "line_number": 66 - } - ], "helm/guppy/README.md": [ { "type": "Secret Keyword", @@ -718,5 +695,5 @@ } ] }, - "generated_at": "2025-06-30T19:20:23Z" + "generated_at": "2025-07-03T17:59:41Z" } diff --git a/helm/gen3-user-data-library/Chart.yaml b/helm/gen3-user-data-library/Chart.yaml index cc482661d..1e8817901 100644 --- a/helm/gen3-user-data-library/Chart.yaml +++ b/helm/gen3-user-data-library/Chart.yaml @@ -15,7 +15,7 @@ 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. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.2 +version: 0.1.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm/gen3-user-data-library/README.md b/helm/gen3-user-data-library/README.md index 0b14d3197..46cce63f0 100644 --- a/helm/gen3-user-data-library/README.md +++ b/helm/gen3-user-data-library/README.md @@ -1,6 +1,6 @@ # gen3-user-data-library -![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: main](https://img.shields.io/badge/AppVersion-main-informational?style=flat-square) +![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: main](https://img.shields.io/badge/AppVersion-main-informational?style=flat-square) A Helm chart for Kubernetes @@ -48,6 +48,7 @@ A Helm chart for Kubernetes | global.postgres.master.port | string | `"5432"` | Port for Postgres. | | global.postgres.master.username | string | `"postgres"` | username of superuser in postgres. This is used to create or restore databases | | gunicornWorkers | int | `1` | | +| hostAliases | list | `[]` | | | image.pullPolicy | string | `"Always"` | | | image.repository | string | `"quay.io/cdis/gen3-user-data-library"` | | | image.tag | string | `"main"` | | @@ -58,6 +59,7 @@ A Helm chart for Kubernetes | ingress.hosts[0].paths[0].path | string | `"/"` | | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ingress.tls | list | `[]` | | +| itemSchemas | string | `nil` | | | livenessProbe.httpGet.path | string | `"/"` | | | livenessProbe.httpGet.port | string | `"http"` | | | metricsEnabled | bool | `false` | Whether Metrics are enabled. | diff --git a/helm/gen3-user-data-library/templates/configmap.yaml b/helm/gen3-user-data-library/templates/configmap.yaml new file mode 100644 index 000000000..918afce6a --- /dev/null +++ b/helm/gen3-user-data-library/templates/configmap.yaml @@ -0,0 +1,9 @@ +{{- if .Values.itemSchemas}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "gen3-user-data-library.fullname" . }}-config +data: + item_schemas.json: |- + {{ .Values.itemSchemas| toJson | indent 4}} +{{- end}} \ No newline at end of file diff --git a/helm/gen3-user-data-library/templates/deployment.yaml b/helm/gen3-user-data-library/templates/deployment.yaml index 542de5cd5..908c827ba 100644 --- a/helm/gen3-user-data-library/templates/deployment.yaml +++ b/helm/gen3-user-data-library/templates/deployment.yaml @@ -30,18 +30,31 @@ spec: {{- include "common.grafanaAnnotations" . | nindent 8 }} {{- end }} spec: + {{- with .Values.hostAliases}} + hostAliases: + {{- toYaml . | nindent 4}} + {{- end}} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} + volumes: - name: gen3-user-data-library-g3auto-volume secret: secretName: gen3userdatalibrary-g3auto + {{- if .Values.itemSchemas }} + - name: gen3-user-data-library-config-volume + configMap: + name: {{ include "gen3-user-data-library.fullname" . }}-config + {{- end }} + containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{- toYaml .Values.env | nindent 12 }} - name: URL_PREFIX @@ -76,10 +89,11 @@ spec: name: gen3-user-data-library-dbcreds key: dbcreated optional: false - imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: - containerPort: 80 name: http + livenessProbe: httpGet: path: /_status @@ -87,22 +101,34 @@ spec: initialDelaySeconds: 30 periodSeconds: 60 timeoutSeconds: 30 + readinessProbe: httpGet: path: /_status port: 80 - {{- with .Values.volumeMounts }} + {{- if or .Values.itemSchemas .Values.volumeMounts }} volumeMounts: - {{- toYaml . | nindent 10 }} - {{- end }} + {{- with .Values.volumeMounts }} + {{ toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.itemSchemas }} + - name: gen3-user-data-library-config-volume + mountPath: /gen3userdatalibrary/config/item_schemas.json + readOnly: true + subPath: item_schemas.json + {{- end }} + {{- end}} + {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} + initContainers: - name: gen3-user-data-library-init image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: - name: GEN3_DEBUG value: "False" @@ -137,14 +163,23 @@ spec: key: dbcreated optional: false - {{- with .Values.volumeMounts }} + {{- if or .Values.itemSchemas .Values.volumeMounts }} volumeMounts: - {{- toYaml . | nindent 12 }} - {{- end }} + {{- with .Values.volumeMounts }} + {{ toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.itemSchemas }} + - name: gen3-user-data-library-config-volume + mountPath: /gen3userdatalibrary/config/item_schemas.json + readOnly: true + subPath: item_schemas.json + {{- end }} + {{- end}} {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} + command: [ "/bin/sh" ] args: - "-c" diff --git a/helm/gen3-user-data-library/values.yaml b/helm/gen3-user-data-library/values.yaml index c35411aaf..5a70a809f 100644 --- a/helm/gen3-user-data-library/values.yaml +++ b/helm/gen3-user-data-library/values.yaml @@ -128,6 +128,7 @@ volumeMounts: readOnly: true subPath: gen3-user-data-library.env + affinity: {} automountServiceAccountToken: false @@ -188,3 +189,10 @@ secrets: # -- (str) AWS secret access key ID. Overrides global key. awsSecretAccessKey: gunicornWorkers: 1 + + +# Item Schema +itemSchemas: Null + +# Host Aliases +hostAliases: []