From f7d74f2c86af5d14129dddcd3ce640f600527409 Mon Sep 17 00:00:00 2001 From: AlexGacon Date: Thu, 8 Feb 2024 11:09:40 +0100 Subject: [PATCH] Allow configuration of pull secrets (#141) --- charts/geonode/README.md | 4 ++++ .../geonode/templates/geonode/geonode-deploy.yaml | 5 +++++ .../templates/geoserver/geoserver-deploy.yaml | 5 +++++ charts/geonode/templates/nginx/nginx-deploy.yaml | 5 +++++ charts/geonode/templates/pycsw/pycsw-deploy.yaml | 6 ++++++ charts/geonode/values.yaml | 14 ++++++++++++++ 6 files changed, 39 insertions(+) diff --git a/charts/geonode/README.md b/charts/geonode/README.md index ee08ef7..3bc92d6 100644 --- a/charts/geonode/README.md +++ b/charts/geonode/README.md @@ -68,6 +68,7 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.1.3, Geoserver: 2.23.0, p | geonode.haystack.search_results_per_page | string | `"200"` | hystack results per page | | geonode.image.name | string | `"52north/geonode"` | used geonode image | | geonode.image.tag | string | `"4.1.3"` | tag of used geonode image | +| geonode.imagePullSecret | string | `""` | secret to use to pull geonode image | | geonode.ingress.annotations | object | `{}` | adds ingress annotations for nginx ingress class | | geonode.ingress.enabled | bool | `true` | enables external access | | geonode.ingress.ingressClassName | string | `nil` | define kubernetes ingress class for geonode ingress | @@ -141,6 +142,7 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.1.3, Geoserver: 2.23.0, p | geoserver.container_name | string | `"geoserver"` | geoserver container name | | geoserver.image.name | string | `"geonode/geoserver"` | geoserver image docker image (default in zalf namespace because geonode one was not up to date) | | geoserver.image.tag | string | `"2.23.0"` | geoserver docker image tag | +| geoserver.imagePullSecret | string | `""` | secret to use to pull geoserver image | | geoserver.pod_name | string | `"geoserver"` | geoserver pod name | | geoserver.port | int | `8080` | geoserver port | | geoserver.resources.limits.cpu | int | `2` | limit cpu as in resource.requests.cpu (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | @@ -159,6 +161,7 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.1.3, Geoserver: 2.23.0, p | nginx.external_cors.enabled | bool | `false` | Add Access-Control-Allow-Origin directive to allow integration from an external domain | | nginx.image.name | string | `"nginx"` | nginx docker image | | nginx.image.tag | string | `"1.25"` | nginx docker image tag | +| nginx.imagePullSecret | string | `""` | secret to use to pull nginx image | | nginx.maxClientBodySize | string | `"2G"` | max file upload size | | nginx.pod_name | string | `"nginx"` | nginx pod name | | nginx.replicaCount | int | `1` | nginx container replicas | @@ -201,6 +204,7 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.1.3, Geoserver: 2.23.0, p | pycsw.endpoint | string | `"/catalogue/csw"` | pycsw url below geonode.ingress.externalDomain | | pycsw.image.name | string | `"geopython/pycsw"` | pycsw docker image | | pycsw.image.tag | string | `"2.6.1"` | pycsw docker image tag | +| pycsw.imagePullSecret | string | `""` | secret to use to pull pycsw image | | pycsw.mappings | string | copied from 4.1.x: https://github.com/GeoNode/geonode/blob/master/geonode/catalogue/backends/pycsw_local_mappings.py | pycsw config file parameters, see docs: https://docs.pycsw.org/_/downloads/en/latest/pdf/ | | pycsw.pod_name | string | `"pysw"` | pycsw pod name | | pycsw.port | int | `8000` | pycsw endpoint port | diff --git a/charts/geonode/templates/geonode/geonode-deploy.yaml b/charts/geonode/templates/geonode/geonode-deploy.yaml index ac49d7d..ecf5792 100644 --- a/charts/geonode/templates/geonode/geonode-deploy.yaml +++ b/charts/geonode/templates/geonode/geonode-deploy.yaml @@ -37,6 +37,11 @@ spec: spec: terminationGracePeriodSeconds: 3 +{{- if not (empty .Values.geonode.imagePullSecret) }} + imagePullSecrets: + - name: {{ .Values.geonode.imagePullSecret }} +{{ end }} + initContainers: # Wait for Postgres and rabbit - name: geonode-wait-for-db-and-rabbit diff --git a/charts/geonode/templates/geoserver/geoserver-deploy.yaml b/charts/geonode/templates/geoserver/geoserver-deploy.yaml index 1646732..2482703 100644 --- a/charts/geonode/templates/geoserver/geoserver-deploy.yaml +++ b/charts/geonode/templates/geoserver/geoserver-deploy.yaml @@ -49,6 +49,11 @@ spec: - name: geoserver-notifier-xml mountPath: /overrides +{{- if not (empty .Values.geoserver.imagePullSecret) }} + imagePullSecrets: + - name: {{ .Values.geoserver.imagePullSecret }} +{{ end }} + containers: - name: {{ .Values.geoserver.container_name }} image: "{{ .Values.geoserver.image.name }}:{{ .Values.geoserver.image.tag }}" diff --git a/charts/geonode/templates/nginx/nginx-deploy.yaml b/charts/geonode/templates/nginx/nginx-deploy.yaml index be10711..fbc64b4 100644 --- a/charts/geonode/templates/nginx/nginx-deploy.yaml +++ b/charts/geonode/templates/nginx/nginx-deploy.yaml @@ -18,6 +18,11 @@ spec: spec: terminationGracePeriodSeconds: 3 +{{- if not (empty .Values.nginx.imagePullSecret) }} + imagePullSecrets: + - name: {{ .Values.nginx.imagePullSecret }} +{{ end }} + containers: - name: {{ .Values.nginx.container_name }} image: "{{ .Values.nginx.image.name }}:{{ .Values.nginx.image.tag }}" diff --git a/charts/geonode/templates/pycsw/pycsw-deploy.yaml b/charts/geonode/templates/pycsw/pycsw-deploy.yaml index 58ffd8d..6b4bb6a 100644 --- a/charts/geonode/templates/pycsw/pycsw-deploy.yaml +++ b/charts/geonode/templates/pycsw/pycsw-deploy.yaml @@ -20,6 +20,12 @@ spec: checksum/pycsw-mappings-py: {{ include (print $.Template.BasePath "/pycsw/pycsw-mappings-py.yaml") . | sha256sum }} spec: terminationGracePeriodSeconds: 3 + +{{- if not (empty .Values.pycsw.imagePullSecret) }} + imagePullSecrets: + - name: {{ .Values.pycsw.imagePullSecret }} +{{ end }} + initContainers: # Wait for GeoNode to be up and running, else there can be a race conddition where pycsw creates the database table, # and lets crash init process of geonode diff --git a/charts/geonode/values.yaml b/charts/geonode/values.yaml index 93785e8..39677bf 100644 --- a/charts/geonode/values.yaml +++ b/charts/geonode/values.yaml @@ -23,6 +23,9 @@ geonode: # -- tag of used geonode image tag: "4.1.3" + # -- pull secret to use for geonode image + imagePullSecret: "" + # -- additions to tasks.py init script, must be additional code written in python tasks_pre_script: | print("tasks_pre_script not defined ...") @@ -330,6 +333,9 @@ geoserver: # -- geoserver port port: 8080 + # -- pull secret to use for geoserver image + imagePullSecret: "" + secret: # -- name of an existing Secret to use. Set, if you want to separately maintain the Secret. existingSecretName: "" @@ -358,6 +364,10 @@ nginx: container_name: nginx # -- nginx container replicas replicaCount: 1 + + # -- pull secret to use for nginx image + imagePullSecret: "" + image: # -- nginx docker image name: nginx @@ -392,6 +402,10 @@ pycsw: replicaCount: 1 # -- pycsw container name container_name: pycsw + + # -- pull secret to use for pycsw image + imagePullSecret: "" + image: # -- pycsw docker image name: geopython/pycsw