From e79a45d6f653b31dd4d56154bc055101b96be496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Thu, 1 Dec 2022 14:50:43 +0100 Subject: [PATCH] feat: add image pull secrets support (#33) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- charts/kyverno-aws-adapter/README.md | 3 +-- charts/kyverno-aws-adapter/templates/deployment.yaml | 4 ++-- charts/kyverno-aws-adapter/templates/secret.yaml | 11 ----------- charts/kyverno-aws-adapter/values.yaml | 8 ++------ 4 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 charts/kyverno-aws-adapter/templates/secret.yaml diff --git a/charts/kyverno-aws-adapter/README.md b/charts/kyverno-aws-adapter/README.md index f76a3a1..aa4bab6 100644 --- a/charts/kyverno-aws-adapter/README.md +++ b/charts/kyverno-aws-adapter/README.md @@ -42,13 +42,12 @@ You’ll need an [EKS](https://aws.amazon.com/eks/) cluster to run against. | pollInterval | int | `30` | Interval at which the controller reconciles in minutes | | eksCluster.name | string | `nil` | EKS cluster name | | eksCluster.region | string | `nil` | EKS cluster region | -| registryConfig.username | string | `nil` | Username to pull the private image (ghcr.io) | -| registryConfig.password | string | `nil` | Password to pull the private image (ghcr.io) | | rbac.create | bool | `true` | Enable RBAC resources creation | | rbac.serviceAccount.name | string | `nil` | Service account name, you MUST provide one when `rbac.create` is set to `false` | | image.repository | string | `"ghcr.io/nirmata/kyverno-aws-adapter"` | Image repository | | image.pullPolicy | string | `"Always"` | Image pull policy | | image.tag | string | `nil` | Image tag (defaults to chart app version) | +| image.imagePullSecrets | list | `[]` | Image pull secrets | ## IAM Role for Service Account diff --git a/charts/kyverno-aws-adapter/templates/deployment.yaml b/charts/kyverno-aws-adapter/templates/deployment.yaml index bc5bcf1..1c93d4b 100644 --- a/charts/kyverno-aws-adapter/templates/deployment.yaml +++ b/charts/kyverno-aws-adapter/templates/deployment.yaml @@ -16,9 +16,9 @@ spec: labels: {{- include "kyverno-aws-adapter.labels" . | nindent 8 }} spec: - {{- if .Values.registryConfig.username }} + {{- with .Values.image.imagePullSecrets }} imagePullSecrets: - - name: {{ include "kyverno-aws-adapter.fullname" . }} + {{- toYaml . | nindent 8 }} {{- end }} containers: - command: diff --git a/charts/kyverno-aws-adapter/templates/secret.yaml b/charts/kyverno-aws-adapter/templates/secret.yaml deleted file mode 100644 index d8910f7..0000000 --- a/charts/kyverno-aws-adapter/templates/secret.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if .Values.registryConfig.username }} -kind: Secret -type: kubernetes.io/dockerconfigjson -apiVersion: v1 -metadata: - name: {{ include "kyverno-aws-adapter.fullname" . }} - labels: - {{- include "kyverno-aws-adapter.labels" . | nindent 4 }} -data: - .dockerconfigjson: {{ include "kyverno-aws-adapter.dockerconfigjson" . }} -{{- end }} \ No newline at end of file diff --git a/charts/kyverno-aws-adapter/values.yaml b/charts/kyverno-aws-adapter/values.yaml index f5a9f71..178679a 100644 --- a/charts/kyverno-aws-adapter/values.yaml +++ b/charts/kyverno-aws-adapter/values.yaml @@ -20,12 +20,6 @@ eksCluster: # -- EKS cluster region region: -registryConfig: - # -- Username to pull the private image (ghcr.io) - username: - # -- Password to pull the private image (ghcr.io) - password: - rbac: # -- Enable RBAC resources creation create: true @@ -41,3 +35,5 @@ image: pullPolicy: Always # -- Image tag (defaults to chart app version) tag: + # -- Image pull secrets + imagePullSecrets: []