From 93f4c65c1c2b0dbbab8459ef0e087170ebc19974 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Tue, 28 Nov 2023 11:20:03 +0100 Subject: [PATCH 1/2] Have a global image section --- README.md | 9 +++++---- diracx/templates/deployment.yaml | 4 ++-- diracx/templates/init-cs/job.yaml | 2 +- diracx/templates/init-sql/job.yaml | 2 +- diracx/templates/web-deployment.yaml | 2 +- diracx/values.yaml | 16 +++++++++------- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a8df25d..28dcb39 100644 --- a/README.md +++ b/README.md @@ -119,16 +119,17 @@ TODO | diracx.settings.DIRACX_CONFIG_BACKEND_URL | string | `"git+file:///cs_store/initialRepo"` | | | diracx.settings.DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS | string | `"[\"http://anything:8000/docs/oauth2-redirect\"]"` | | | diracx.settings.DIRACX_SERVICE_AUTH_TOKEN_KEY | string | `"file:///signing-key/rsa256.key"` | | -| diracxWeb.image.repository | string | `"ghcr.io/diracgrid/diracx-web/static"` | | -| diracxWeb.image.tag | string | `"latest"` | | | diracxWeb.service.port | int | `8080` | | | diracxWeb.service.type | string | `"ClusterIP"` | | | fullnameOverride | string | `""` | | | global.activeDeadlineSeconds | int | `900` | | | global.batchJobTTL | int | `600` | | | global.imagePullPolicy | string | `"Always"` | | -| image.repository | string | `"ghcr.io/diracgrid/diracx/server"` | | -| image.tag | string | `"latest"` | | +| global.images.client | string | `"ghcr.io/diracgrid/diracx/client"` | | +| global.images.services | string | `"ghcr.io/diracgrid/diracx/services"` | | +| global.images.tag | string | `"latest"` | | +| global.images.web.repository | string | `"ghcr.io/diracgrid/diracx-web/static"` | | +| global.images.web.tag | string | `"latest"` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `"nginx"` | | | ingress.enabled | bool | `true` | | diff --git a/diracx/templates/deployment.yaml b/diracx/templates/deployment.yaml index ac9bb28..37fc857 100644 --- a/diracx/templates/deployment.yaml +++ b/diracx/templates/deployment.yaml @@ -88,7 +88,7 @@ spec: initContainers: {{- if .Values.diracx.manageOSIndices }} - name: create-os-db-indices - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.global.images.services }}:{{ .Values.global.images.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.global.imagePullPolicy }} command: ["bash", "/entrypoint.sh"] args: ["python", "-m", "diracx.db", "init-os"] @@ -101,7 +101,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.global.images.services }}:{{ .Values.global.images.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.global.imagePullPolicy }} ports: - name: http diff --git a/diracx/templates/init-cs/job.yaml b/diracx/templates/init-cs/job.yaml index 87e3a21..e83a7b7 100644 --- a/diracx/templates/init-cs/job.yaml +++ b/diracx/templates/init-cs/job.yaml @@ -40,7 +40,7 @@ spec: restartPolicy: Never containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.global.images.client }}:{{ .Values.global.images.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.global.imagePullPolicy }} command: ["/bin/bash", "/entrypoint.sh"] args: ["/bin/bash", "/scripts/init-cs"] diff --git a/diracx/templates/init-sql/job.yaml b/diracx/templates/init-sql/job.yaml index 936af71..8494010 100644 --- a/diracx/templates/init-sql/job.yaml +++ b/diracx/templates/init-sql/job.yaml @@ -39,7 +39,7 @@ spec: restartPolicy: Never containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.global.images.services }}:{{ .Values.global.images.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.global.imagePullPolicy }} command: ["/bin/bash", "/entrypoint.sh"] args: ["/bin/bash", "/scripts/init-sql"] diff --git a/diracx/templates/web-deployment.yaml b/diracx/templates/web-deployment.yaml index d2d5c08..e63ebe5 100644 --- a/diracx/templates/web-deployment.yaml +++ b/diracx/templates/web-deployment.yaml @@ -70,7 +70,7 @@ spec: {{- if $nodeDevInstall }} image: {{ .Values.developer.nodeImage }} {{- else }} - image: {{ .Values.diracxWeb.image.repository }}:{{ .Values.diracxWeb.image.tag }} + image: {{ .Values.global.images.web.repository }}:{{ .Values.global.images.web.tag }} {{- end }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} ports: diff --git a/diracx/values.yaml b/diracx/values.yaml index 8a4e5d6..cb21005 100644 --- a/diracx/values.yaml +++ b/diracx/values.yaml @@ -12,13 +12,16 @@ global: imagePullPolicy: Always # timeout for job deadlines activeDeadlineSeconds: 900 + images: + tag: "latest" + services: ghcr.io/diracgrid/diracx/services + client: ghcr.io/diracgrid/diracx/client + web: + tag: "latest" + repository: ghcr.io/diracgrid/diracx-web/static replicaCount: 1 -image: - repository: ghcr.io/diracgrid/diracx/server - # Overrides the image tag whose default is the chart appVersion. - tag: "latest" # Created with # kubectl create secret generic regcred \ @@ -58,6 +61,7 @@ securityContext: {} ################# init-cs: + # Automatically initialize the repository in the CS volume enabled: true # Users which should be automatically added to the CS @@ -103,6 +107,7 @@ developer: ipAlias: null diracx: + # Required: The hostname where the webapp/API is running # hostname: # Settings to inject into the API container via environment variables @@ -138,9 +143,6 @@ ingress: annotations: {} diracxWeb: - image: - repository: ghcr.io/diracgrid/diracx-web/static - tag: latest service: type: ClusterIP port: 8080 From 16fe2a328d6d012a46a34661bd77a04b06ddf0f3 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Tue, 28 Nov 2023 11:31:03 +0100 Subject: [PATCH 2/2] Try dev version --- README.md | 2 +- diracx/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28dcb39..3efe736 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ TODO | global.imagePullPolicy | string | `"Always"` | | | global.images.client | string | `"ghcr.io/diracgrid/diracx/client"` | | | global.images.services | string | `"ghcr.io/diracgrid/diracx/services"` | | -| global.images.tag | string | `"latest"` | | +| global.images.tag | string | `"dev"` | | | global.images.web.repository | string | `"ghcr.io/diracgrid/diracx-web/static"` | | | global.images.web.tag | string | `"latest"` | | | ingress.annotations | object | `{}` | | diff --git a/diracx/values.yaml b/diracx/values.yaml index cb21005..190badf 100644 --- a/diracx/values.yaml +++ b/diracx/values.yaml @@ -13,7 +13,7 @@ global: # timeout for job deadlines activeDeadlineSeconds: 900 images: - tag: "latest" + tag: "dev" services: ghcr.io/diracgrid/diracx/services client: ghcr.io/diracgrid/diracx/client web: