From 455a32bdab0fa1b2ceb814466c3ec3e08b2545fd Mon Sep 17 00:00:00 2001 From: Adrian Berger Date: Thu, 26 Oct 2023 11:08:19 +0000 Subject: [PATCH] Make pullSecret configurable Signed-off-by: Adrian Berger --- charts/common/Chart.yaml | 2 +- charts/common/README.md | 2 +- charts/common/templates/_pod.yaml | 6 +++++- charts/common/values.schema.json | 14 +++++++++++++- charts/common/values.yaml | 10 +++++++--- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index b5a58983..ab6afddf 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: common description: "Bedag's common Helm chart to use for creating other Helm charts" -version: 10.7.0 +version: 10.8.0 # 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 diff --git a/charts/common/README.md b/charts/common/README.md index b5cb980b..78c40722 100644 --- a/charts/common/README.md +++ b/charts/common/README.md @@ -1,6 +1,6 @@ # common -![Version: 10.7.0](https://img.shields.io/badge/Version-10.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 10.8.0](https://img.shields.io/badge/Version-10.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Bedag's common Helm chart to use for creating other Helm charts diff --git a/charts/common/templates/_pod.yaml b/charts/common/templates/_pod.yaml index ce3428b1..1dcabff8 100644 --- a/charts/common/templates/_pod.yaml +++ b/charts/common/templates/_pod.yaml @@ -146,11 +146,15 @@ tolerations: {{- if $root.Values.secrets }} {{- if $root.Values.secrets.data }} {{- if $root.Values.secrets.data.registry }} -{{- if $root.Values.secrets.data.registry.pullSecret }} +{{- if $root.Values.secrets.data.registry.pullSecret.enabled }} imagePullSecrets: +{{- if $root.Values.secrets.data.registry.pullSecret.name }} + - name: {{ $root.Values.secrets.data.registry.pullSecret.name }} +{{- else }} - name: {{ template "library.name" $root }}-registry-pull-secret {{- end }} {{- end }} {{- end }} {{- end }} +{{- end }} {{- end -}} diff --git a/charts/common/values.schema.json b/charts/common/values.schema.json index 596a0581..bc162862 100644 --- a/charts/common/values.schema.json +++ b/charts/common/values.schema.json @@ -384,7 +384,19 @@ ], "properties": { "pullSecret": { - "type": "boolean" + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "name": { + "type": "string" + } + } } } } diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 820e4272..15f12ed7 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -16,12 +16,16 @@ defaultTag: latest # timezone to set as environment variable 'TZ' in each pod. Comment out for using default ("Europe/Zurich") # timezone: "Europe/Zurich" -# secrets contains the pullSecret for the container registry to pull images. Set to 'true' to use a pullSecret. -# The secret name consists of the 'library.name' variable and the suffix '-registry-pull-secret'. +# secrets contains the pullSecret for the container registry to pull images. Set 'enabled' to 'true' to use a pullSecret. +# The secret name consists of the 'library.name' variable and the suffix '-registry-pull-secret' if 'name' is not specified. secrets: data: registry: - pullSecret: false + pullSecret: + # enabled activates the imagePullSecrets in the pod spec + enabled: false + # name is optional to override the default name, if omitted uses '{{ template "library.name" $root }}-registry-pull-secret' + # name: example-foo # start common.networkpolicy # -- networkpolicy restricts all access between the pods. To configure allowed connections, go to components.*.networkpolicy.podSelector