From 7ff22407fbbbe0a3c6222bb6cd6347b734899da2 Mon Sep 17 00:00:00 2001 From: gaoshiyao Date: Sun, 9 Apr 2023 11:36:24 +0800 Subject: [PATCH] registrySecrets --- templates/chartmuseum/chartmuseum-dpl.yaml | 4 ++++ templates/clair/clair-dpl.yaml | 4 ++++ templates/core/core-dpl.yaml | 4 ++++ templates/database/database-ss.yaml | 4 ++++ templates/imagePullSecret.yaml | 10 ++++++++++ templates/jobservice/jobservice-dpl.yaml | 4 ++++ templates/nginx/deployment.yaml | 4 ++++ templates/notary/notary-server.yaml | 4 ++++ templates/portal/deployment.yaml | 4 ++++ templates/redis/statefulset.yaml | 4 ++++ templates/registry/registry-dpl.yaml | 4 ++++ templates/trivy/trivy-sts.yaml | 4 ++++ values-operator.yaml | 6 +++++- 13 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 templates/imagePullSecret.yaml diff --git a/templates/chartmuseum/chartmuseum-dpl.yaml b/templates/chartmuseum/chartmuseum-dpl.yaml index 85ac70e..4c151d3 100644 --- a/templates/chartmuseum/chartmuseum-dpl.yaml +++ b/templates/chartmuseum/chartmuseum-dpl.yaml @@ -35,6 +35,10 @@ spec: {{ toYaml .Values.chartmuseum.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 10000 {{- if .Values.chartmuseum.serviceAccountName }} diff --git a/templates/clair/clair-dpl.yaml b/templates/clair/clair-dpl.yaml index 69ee736..ea824d3 100644 --- a/templates/clair/clair-dpl.yaml +++ b/templates/clair/clair-dpl.yaml @@ -28,6 +28,10 @@ spec: {{ toYaml .Values.clair.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 10000 {{- if .Values.clair.serviceAccountName }} diff --git a/templates/core/core-dpl.yaml b/templates/core/core-dpl.yaml index 4a913c7..eaf7354 100644 --- a/templates/core/core-dpl.yaml +++ b/templates/core/core-dpl.yaml @@ -29,6 +29,10 @@ spec: {{ toYaml .Values.core.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 10000 {{- if .Values.core.serviceAccountName }} diff --git a/templates/database/database-ss.yaml b/templates/database/database-ss.yaml index d429042..6a53fe7 100644 --- a/templates/database/database-ss.yaml +++ b/templates/database/database-ss.yaml @@ -25,6 +25,10 @@ spec: {{ toYaml .Values.database.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} {{- if .Values.database.internal.serviceAccountName }} serviceAccountName: {{ .Values.database.internal.serviceAccountName }} {{- end -}} diff --git a/templates/imagePullSecret.yaml b/templates/imagePullSecret.yaml new file mode 100644 index 0000000..3828742 --- /dev/null +++ b/templates/imagePullSecret.yaml @@ -0,0 +1,10 @@ +{{- if .Values.registrySecrets -}} +kind: Secret +apiVersion: v1 +metadata: + name: beagle-registry + namespace: {{ .Release.Namespace}} +data: + .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5iZWFnbGUuZGVmYXVsdDo2NDQ0IjogewoJCQkiYXV0aCI6ICJZbVZoWjJ4bE9tSmxZV2RzWlE9PSIKCQl9Cgl9Cn0= +type: kubernetes.io/dockerconfigjson +{{- end -}} \ No newline at end of file diff --git a/templates/jobservice/jobservice-dpl.yaml b/templates/jobservice/jobservice-dpl.yaml index cce7395..4ba94a9 100644 --- a/templates/jobservice/jobservice-dpl.yaml +++ b/templates/jobservice/jobservice-dpl.yaml @@ -35,6 +35,10 @@ spec: {{ toYaml .Values.jobservice.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 10000 {{- if .Values.jobservice.serviceAccountName }} diff --git a/templates/nginx/deployment.yaml b/templates/nginx/deployment.yaml index e59ecaa..9903d8a 100644 --- a/templates/nginx/deployment.yaml +++ b/templates/nginx/deployment.yaml @@ -30,6 +30,10 @@ spec: {{ toYaml .Values.nginx.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} {{- if .Values.nginx.serviceAccountName }} serviceAccountName: {{ .Values.nginx.serviceAccountName }} {{- end }} diff --git a/templates/notary/notary-server.yaml b/templates/notary/notary-server.yaml index 7709506..814a7ea 100644 --- a/templates/notary/notary-server.yaml +++ b/templates/notary/notary-server.yaml @@ -24,6 +24,10 @@ spec: {{ toYaml .Values.notary.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 10000 {{- if .Values.notary.server.serviceAccountName }} diff --git a/templates/portal/deployment.yaml b/templates/portal/deployment.yaml index 0cd1721..781e690 100644 --- a/templates/portal/deployment.yaml +++ b/templates/portal/deployment.yaml @@ -26,6 +26,10 @@ spec: {{ toYaml .Values.portal.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/templates/redis/statefulset.yaml b/templates/redis/statefulset.yaml index eeb211c..8b55798 100644 --- a/templates/redis/statefulset.yaml +++ b/templates/redis/statefulset.yaml @@ -24,6 +24,10 @@ spec: {{ toYaml .Values.redis.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 999 {{- if .Values.redis.internal.serviceAccountName }} diff --git a/templates/registry/registry-dpl.yaml b/templates/registry/registry-dpl.yaml index 316b645..a711c26 100644 --- a/templates/registry/registry-dpl.yaml +++ b/templates/registry/registry-dpl.yaml @@ -35,6 +35,10 @@ spec: {{ toYaml .Values.registry.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} securityContext: fsGroup: 10000 {{- if .Values.registry.serviceAccountName }} diff --git a/templates/trivy/trivy-sts.yaml b/templates/trivy/trivy-sts.yaml index 273fbb6..2d3137d 100644 --- a/templates/trivy/trivy-sts.yaml +++ b/templates/trivy/trivy-sts.yaml @@ -30,6 +30,10 @@ spec: {{ toYaml .Values.trivy.podAnnotations | indent 8 }} {{- end }} spec: +{{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} +{{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/values-operator.yaml b/values-operator.yaml index 633bd59..a728bbf 100644 --- a/values-operator.yaml +++ b/values-operator.yaml @@ -2,4 +2,8 @@ global: hub: registry.cn-qingdao.aliyuncs.com/wod imagePullPolicy: "IfNotPresent" imageArch: amd64 - host: wodcloud.local \ No newline at end of file + host: wodcloud.local + imagePullSecrets: + - name: beagle-registry + +registrySecrets: true \ No newline at end of file -- 2.26.0