From 09482c593dfd4835c0d396546e837cff3eb07254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Wed, 18 Oct 2023 10:57:14 +0200 Subject: [PATCH] fix: add registries for helm chart --- Makefile | 2 +- charts/capsule/README.md | 4 +++- charts/capsule/templates/_helpers.tpl | 6 +++--- charts/capsule/values.yaml | 6 +++++- config/install.yaml | 2 +- config/manager/kustomization.yaml | 3 +-- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 0c05ff352..078820414 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ run: generate manifests # Creates the single file to install Capsule without any external dependency installer: manifests kustomize - cd config/manager && $(KUSTOMIZE) edit set image controller=${LOCAL_CAPSULE_IMG} + cd config/manager && $(KUSTOMIZE) edit set image controller=${CAPSULE_IMG}:${VERSION} $(KUSTOMIZE) build config/default > config/install.yaml # Install CRDs into a cluster diff --git a/charts/capsule/README.md b/charts/capsule/README.md index af1a2063c..23813f9da 100644 --- a/charts/capsule/README.md +++ b/charts/capsule/README.md @@ -76,6 +76,7 @@ Here the values you can override: | customLabels | object | `{}` | Additional labels which will be added to all resources created by Capsule helm chart | | imagePullSecrets | list | `[]` | Configuration for `imagePullSecrets` so that you can use a private images registry. | | jobs.image.pullPolicy | string | `"IfNotPresent"` | Set the image pull policy of the helm chart job | +| jobs.image.registry | string | `"docker.io"` | Set the image repository of the helm chart job | | jobs.image.repository | string | `"clastix/kubectl"` | Set the image repository of the helm chart job | | jobs.image.tag | string | `""` | Set the image tag of the helm chart job | | mutatingWebhooksTimeoutSeconds | int | `30` | Timeout in seconds for mutating webhooks | @@ -102,7 +103,8 @@ Here the values you can override: |-----|------|---------|-------------| | manager.hostNetwork | bool | `false` | Specifies if the container should be started in hostNetwork mode. Required for use in some managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico), because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working | | manager.image.pullPolicy | string | `"IfNotPresent"` | Set the image pull policy. | -| manager.image.repository | string | `"projectcapsule/capsule"` | Set the image repository of the capsule. | +| manager.image.registry | string | `"ghcr.io"` | Set the image registry of capsule. | +| manager.image.repository | string | `"projectcapsule/capsule"` | Set the image repository of capsule. | | manager.image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | manager.kind | string | `"Deployment"` | Set the controller deployment mode as `Deployment` or `DaemonSet`. | | manager.livenessProbe | object | `{"httpGet":{"path":"/healthz","port":10080}}` | Configure the liveness probe using Deployment probe spec | diff --git a/charts/capsule/templates/_helpers.tpl b/charts/capsule/templates/_helpers.tpl index 80d8a2e6e..64680fdcb 100644 --- a/charts/capsule/templates/_helpers.tpl +++ b/charts/capsule/templates/_helpers.tpl @@ -80,7 +80,7 @@ Create the name of the service account to use Create the manager fully-qualified Docker image to use */}} {{- define "capsule.managerFullyQualifiedDockerImage" -}} -{{- printf "%s:%s" .Values.manager.image.repository ( .Values.manager.image.tag | default (printf "v%s" .Chart.AppVersion) ) -}} +{{- printf "%s/%s:%s" .Values.manager.image.registry .Values.manager.image.repository ( .Values.manager.image.tag | default (printf "v%s" .Chart.AppVersion) ) -}} {{- end }} {{/* @@ -106,9 +106,9 @@ Create the jobs fully-qualified Docker image to use */}} {{- define "capsule.jobsFullyQualifiedDockerImage" -}} {{- if .Values.jobs.image.tag }} -{{- printf "%s:%s" .Values.jobs.image.repository .Values.jobs.image.tag -}} +{{- printf "%s/%s:%s" .Values.jobs.image.registry .Values.jobs.image.repository .Values.jobs.image.tag -}} {{- else }} -{{- printf "%s:%s" .Values.jobs.image.repository (include "capsule.jobsTagKubeVersion" .) -}} +{{- printf "%s/%s:%s" .Values.jobs.image.registry .Values.jobs.image.repository (include "capsule.jobsTagKubeVersion" .) -}} {{- end }} {{- end }} diff --git a/charts/capsule/values.yaml b/charts/capsule/values.yaml index 1d8fa1a1e..828943936 100644 --- a/charts/capsule/values.yaml +++ b/charts/capsule/values.yaml @@ -18,7 +18,9 @@ manager: kind: Deployment image: - # -- Set the image repository of the capsule. + # -- Set the image registry of capsule. + registry: ghcr.io + # -- Set the image repository of capsule. repository: projectcapsule/capsule # -- Set the image pull policy. pullPolicy: IfNotPresent @@ -135,6 +137,8 @@ podSecurityPolicy: jobs: image: + # -- Set the image repository of the helm chart job + registry: docker.io # -- Set the image repository of the helm chart job repository: clastix/kubectl # -- Set the image pull policy of the helm chart job diff --git a/config/install.yaml b/config/install.yaml index dc3feea3c..90b2e35d1 100644 --- a/config/install.yaml +++ b/config/install.yaml @@ -2769,7 +2769,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: clastix/capsule:v0.3.3 + image: ghcr.io/projectcapsule/capsule imagePullPolicy: IfNotPresent name: manager ports: diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5274894d4..150cf7a0f 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -6,5 +6,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: clastix/capsule - newTag: v0.3.3 + newName: ghcr.io/projectcapsule/capsule