From 0be9b1a89f96d4d341813aa27e4196bf0e19d342 Mon Sep 17 00:00:00 2001 From: Kellen Sappington Date: Fri, 26 Jul 2024 06:43:01 -0400 Subject: [PATCH] Fix ArgoCD integration by adding metadata.namespace to all templates Signed-off-by: Kellen Sappington --- templates/core/core-cm.yaml | 3 ++- templates/core/core-dpl.yaml | 1 + templates/core/core-pre-upgrade-job.yaml | 3 ++- templates/core/core-secret.yaml | 1 + templates/core/core-svc.yaml | 1 + templates/core/core-tls.yaml | 3 ++- templates/database/database-secret.yaml | 1 + templates/database/database-ss.yaml | 1 + templates/database/database-svc.yaml | 3 ++- templates/exporter/exporter-cm-env.yaml | 3 ++- templates/exporter/exporter-dpl.yaml | 1 + templates/exporter/exporter-secret.yaml | 1 + templates/exporter/exporter-svc.yaml | 1 + templates/ingress/ingress.yaml | 1 + templates/ingress/secret.yaml | 3 ++- templates/internal/auto-tls.yaml | 7 ++++++- templates/jobservice/jobservice-cm-env.yaml | 1 + templates/jobservice/jobservice-cm.yaml | 1 + templates/jobservice/jobservice-dpl.yaml | 1 + templates/jobservice/jobservice-pvc.yaml | 1 + templates/jobservice/jobservice-secrets.yaml | 1 + templates/jobservice/jobservice-svc.yaml | 1 + templates/jobservice/jobservice-tls.yaml | 3 ++- templates/metrics/metrics-svcmon.yaml | 1 + templates/nginx/configmap-http.yaml | 1 + templates/nginx/configmap-https.yaml | 1 + templates/nginx/deployment.yaml | 1 + templates/nginx/secret.yaml | 3 ++- templates/nginx/service.yaml | 1 + templates/portal/configmap.yaml | 1 + templates/portal/deployment.yaml | 1 + templates/portal/service.yaml | 1 + templates/portal/tls.yaml | 1 + templates/redis/service.yaml | 3 ++- templates/redis/statefulset.yaml | 1 + templates/registry/registry-cm.yaml | 1 + templates/registry/registry-dpl.yaml | 1 + templates/registry/registry-pvc.yaml | 3 ++- templates/registry/registry-secret.yaml | 2 ++ templates/registry/registry-svc.yaml | 3 ++- templates/registry/registry-tls.yaml | 3 ++- templates/registry/registryctl-cm.yaml | 1 + templates/registry/registryctl-secret.yaml | 3 ++- templates/trivy/trivy-secret.yaml | 1 + templates/trivy/trivy-sts.yaml | 1 + templates/trivy/trivy-svc.yaml | 1 + templates/trivy/trivy-tls.yaml | 1 + 47 files changed, 66 insertions(+), 14 deletions(-) diff --git a/templates/core/core-cm.yaml b/templates/core/core-cm.yaml index 93cab01b4..f27bdaaaf 100644 --- a/templates/core/core-cm.yaml +++ b/templates/core/core-cm.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "harbor.core" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: @@ -87,4 +88,4 @@ data: {{- if .Values.core.quotaUpdateProvider }} QUOTA_UPDATE_PROVIDER: "{{ .Values.core.quotaUpdateProvider }}" - {{- end }} \ No newline at end of file + {{- end }} diff --git a/templates/core/core-dpl.yaml b/templates/core/core-dpl.yaml index 2ee8fd59c..4705c5f6e 100644 --- a/templates/core/core-dpl.yaml +++ b/templates/core/core-dpl.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "harbor.core" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: core diff --git a/templates/core/core-pre-upgrade-job.yaml b/templates/core/core-pre-upgrade-job.yaml index ce0b13134..872715694 100644 --- a/templates/core/core-pre-upgrade-job.yaml +++ b/templates/core/core-pre-upgrade-job.yaml @@ -3,6 +3,7 @@ apiVersion: batch/v1 kind: Job metadata: name: migration-job + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: migrator @@ -74,4 +75,4 @@ spec: tolerations: {{ toYaml . | indent 8 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/core/core-secret.yaml b/templates/core/core-secret.yaml index 62a41fce8..ea9d4cfab 100644 --- a/templates/core/core-secret.yaml +++ b/templates/core/core-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "harbor.core" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque diff --git a/templates/core/core-svc.yaml b/templates/core/core-svc.yaml index 0d2cfb291..f918eb388 100644 --- a/templates/core/core-svc.yaml +++ b/templates/core/core-svc.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "harbor.core" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} {{- with .Values.core.serviceAnnotations }} diff --git a/templates/core/core-tls.yaml b/templates/core/core-tls.yaml index c52148f0d..d90d30c8f 100644 --- a/templates/core/core-tls.yaml +++ b/templates/core/core-tls.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.core.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -12,4 +13,4 @@ data: tls.crt: {{ (required "The \"internalTLS.core.crt\" is required!" .Values.internalTLS.core.crt) | b64enc | quote }} tls.key: {{ (required "The \"internalTLS.core.key\" is required!" .Values.internalTLS.core.key) | b64enc | quote }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/database/database-secret.yaml b/templates/database/database-secret.yaml index 864aff4a1..0d07ec26f 100644 --- a/templates/database/database-secret.yaml +++ b/templates/database/database-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.database" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque diff --git a/templates/database/database-ss.yaml b/templates/database/database-ss.yaml index 71c5eb1e0..9bd5c096c 100644 --- a/templates/database/database-ss.yaml +++ b/templates/database/database-ss.yaml @@ -4,6 +4,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: "{{ template "harbor.database" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: database diff --git a/templates/database/database-svc.yaml b/templates/database/database-svc.yaml index 6475048cd..e2085a058 100644 --- a/templates/database/database-svc.yaml +++ b/templates/database/database-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "harbor.database" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} spec: @@ -11,4 +12,4 @@ spec: selector: {{ include "harbor.matchLabels" . | indent 4 }} component: database -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/templates/exporter/exporter-cm-env.yaml b/templates/exporter/exporter-cm-env.yaml index 0bf4e7d90..3f911032b 100644 --- a/templates/exporter/exporter-cm-env.yaml +++ b/templates/exporter/exporter-cm-env.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ template "harbor.exporter" . }}-env" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: @@ -32,4 +33,4 @@ data: HARBOR_DATABASE_SSLMODE: "{{ template "harbor.database.sslmode" . }}" HARBOR_DATABASE_MAX_IDLE_CONNS: "{{ .Values.database.maxIdleConns }}" HARBOR_DATABASE_MAX_OPEN_CONNS: "{{ .Values.database.maxOpenConns }}" -{{- end}} \ No newline at end of file +{{- end}} diff --git a/templates/exporter/exporter-dpl.yaml b/templates/exporter/exporter-dpl.yaml index 01e9258ea..32fac20ac 100644 --- a/templates/exporter/exporter-dpl.yaml +++ b/templates/exporter/exporter-dpl.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "harbor.exporter" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: exporter diff --git a/templates/exporter/exporter-secret.yaml b/templates/exporter/exporter-secret.yaml index 434a1bf68..02c74d03c 100644 --- a/templates/exporter/exporter-secret.yaml +++ b/templates/exporter/exporter-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "harbor.exporter" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque diff --git a/templates/exporter/exporter-svc.yaml b/templates/exporter/exporter-svc.yaml index 4a6f3fdec..6d0d83193 100644 --- a/templates/exporter/exporter-svc.yaml +++ b/templates/exporter/exporter-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "harbor.exporter" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} spec: diff --git a/templates/ingress/ingress.yaml b/templates/ingress/ingress.yaml index 73472c605..0b23cb43c 100644 --- a/templates/ingress/ingress.yaml +++ b/templates/ingress/ingress.yaml @@ -35,6 +35,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: "{{ template "harbor.ingress" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} {{- if $ingress.labels }} diff --git a/templates/ingress/secret.yaml b/templates/ingress/secret.yaml index 41507b3dd..90ba27511 100644 --- a/templates/ingress/secret.yaml +++ b/templates/ingress/secret.yaml @@ -5,6 +5,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.ingress" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -12,4 +13,4 @@ data: tls.crt: {{ $cert.Cert | b64enc | quote }} tls.key: {{ $cert.Key | b64enc | quote }} ca.crt: {{ $ca.Cert | b64enc | quote }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/internal/auto-tls.yaml b/templates/internal/auto-tls.yaml index da5f5e2c7..32807cfd1 100644 --- a/templates/internal/auto-tls.yaml +++ b/templates/internal/auto-tls.yaml @@ -14,6 +14,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.core.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -27,6 +28,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.jobservice.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -40,6 +42,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.registry.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -53,6 +56,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.portal.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -69,6 +73,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.trivy.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -78,4 +83,4 @@ data: tls.key: {{ $trivyCrt.Key | b64enc | quote }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/jobservice/jobservice-cm-env.yaml b/templates/jobservice/jobservice-cm-env.yaml index 8411c7a47..2b9307455 100644 --- a/templates/jobservice/jobservice-cm-env.yaml +++ b/templates/jobservice/jobservice-cm-env.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ template "harbor.jobservice" . }}-env" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/jobservice/jobservice-cm.yaml b/templates/jobservice/jobservice-cm.yaml index 8211c6220..c950e6787 100644 --- a/templates/jobservice/jobservice-cm.yaml +++ b/templates/jobservice/jobservice-cm.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ template "harbor.jobservice" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/jobservice/jobservice-dpl.yaml b/templates/jobservice/jobservice-dpl.yaml index 1bb669082..3e426694b 100644 --- a/templates/jobservice/jobservice-dpl.yaml +++ b/templates/jobservice/jobservice-dpl.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: "{{ template "harbor.jobservice" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: jobservice diff --git a/templates/jobservice/jobservice-pvc.yaml b/templates/jobservice/jobservice-pvc.yaml index 3f7d00b67..eb781eed1 100644 --- a/templates/jobservice/jobservice-pvc.yaml +++ b/templates/jobservice/jobservice-pvc.yaml @@ -4,6 +4,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: {{ template "harbor.jobservice" . }} + namespace: {{ .Release.Namespace | quote }} annotations: {{- range $key, $value := $jobLog.annotations }} {{ $key }}: {{ $value | quote }} diff --git a/templates/jobservice/jobservice-secrets.yaml b/templates/jobservice/jobservice-secrets.yaml index eeb00bde0..7706c3513 100644 --- a/templates/jobservice/jobservice-secrets.yaml +++ b/templates/jobservice/jobservice-secrets.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.jobservice" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque diff --git a/templates/jobservice/jobservice-svc.yaml b/templates/jobservice/jobservice-svc.yaml index d2b7a47fd..483b40ed5 100644 --- a/templates/jobservice/jobservice-svc.yaml +++ b/templates/jobservice/jobservice-svc.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "harbor.jobservice" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} spec: diff --git a/templates/jobservice/jobservice-tls.yaml b/templates/jobservice/jobservice-tls.yaml index 234cb3999..58809ec46 100644 --- a/templates/jobservice/jobservice-tls.yaml +++ b/templates/jobservice/jobservice-tls.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.jobservice.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -12,4 +13,4 @@ data: tls.crt: {{ (required "The \"internalTLS.jobservice.crt\" is required!" .Values.internalTLS.jobservice.crt) | b64enc | quote }} tls.key: {{ (required "The \"internalTLS.jobservice.key\" is required!" .Values.internalTLS.jobservice.key) | b64enc | quote }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/metrics/metrics-svcmon.yaml b/templates/metrics/metrics-svcmon.yaml index 1122ef01e..d566285ed 100644 --- a/templates/metrics/metrics-svcmon.yaml +++ b/templates/metrics/metrics-svcmon.yaml @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "harbor.fullname" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | nindent 4 }} {{- if .Values.metrics.serviceMonitor.additionalLabels }} {{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} diff --git a/templates/nginx/configmap-http.yaml b/templates/nginx/configmap-http.yaml index c4b8354d0..8c25ff211 100644 --- a/templates/nginx/configmap-http.yaml +++ b/templates/nginx/configmap-http.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "harbor.nginx" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/nginx/configmap-https.yaml b/templates/nginx/configmap-https.yaml index 56c943a61..5d625f81e 100644 --- a/templates/nginx/configmap-https.yaml +++ b/templates/nginx/configmap-https.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "harbor.nginx" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/nginx/deployment.yaml b/templates/nginx/deployment.yaml index 3abc94198..04faa3735 100644 --- a/templates/nginx/deployment.yaml +++ b/templates/nginx/deployment.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "harbor.nginx" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: nginx diff --git a/templates/nginx/secret.yaml b/templates/nginx/secret.yaml index c819c556d..369bd65d6 100644 --- a/templates/nginx/secret.yaml +++ b/templates/nginx/secret.yaml @@ -5,6 +5,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "harbor.nginx" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque @@ -20,4 +21,4 @@ data: tls.key: {{ $cert.Key | b64enc | quote }} ca.crt: {{ $ca.Cert | b64enc | quote }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/nginx/service.yaml b/templates/nginx/service.yaml index 691584ce0..7eac84ee1 100644 --- a/templates/nginx/service.yaml +++ b/templates/nginx/service.yaml @@ -5,6 +5,7 @@ metadata: {{- if eq .Values.expose.type "clusterIP" }} {{- $clusterIP := .Values.expose.clusterIP }} name: {{ $clusterIP.name }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} {{- if .Values.expose.clusterIP.labels }} diff --git a/templates/portal/configmap.yaml b/templates/portal/configmap.yaml index 7b2118e72..af56783a8 100644 --- a/templates/portal/configmap.yaml +++ b/templates/portal/configmap.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ template "harbor.portal" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/portal/deployment.yaml b/templates/portal/deployment.yaml index 4dea94438..88bcd4979 100644 --- a/templates/portal/deployment.yaml +++ b/templates/portal/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: "{{ template "harbor.portal" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: portal diff --git a/templates/portal/service.yaml b/templates/portal/service.yaml index d00026da4..c1273f072 100644 --- a/templates/portal/service.yaml +++ b/templates/portal/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "harbor.portal" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} {{- with .Values.portal.serviceAnnotations }} diff --git a/templates/portal/tls.yaml b/templates/portal/tls.yaml index de63f4e81..e61a7d3a4 100644 --- a/templates/portal/tls.yaml +++ b/templates/portal/tls.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.portal.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls diff --git a/templates/redis/service.yaml b/templates/redis/service.yaml index 79c95c3e0..61c21d13e 100644 --- a/templates/redis/service.yaml +++ b/templates/redis/service.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "harbor.redis" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} spec: @@ -11,4 +12,4 @@ spec: selector: {{ include "harbor.matchLabels" . | indent 4 }} component: redis -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/templates/redis/statefulset.yaml b/templates/redis/statefulset.yaml index 1d37fb184..fa5dd22d2 100644 --- a/templates/redis/statefulset.yaml +++ b/templates/redis/statefulset.yaml @@ -4,6 +4,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ template "harbor.redis" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: redis diff --git a/templates/registry/registry-cm.yaml b/templates/registry/registry-cm.yaml index 4f7056c38..26e3fc915 100644 --- a/templates/registry/registry-cm.yaml +++ b/templates/registry/registry-cm.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ template "harbor.registry" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/registry/registry-dpl.yaml b/templates/registry/registry-dpl.yaml index 0965cf2e2..6310b9de0 100644 --- a/templates/registry/registry-dpl.yaml +++ b/templates/registry/registry-dpl.yaml @@ -4,6 +4,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: "{{ template "harbor.registry" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: registry diff --git a/templates/registry/registry-pvc.yaml b/templates/registry/registry-pvc.yaml index 5d6d4d3dd..712c21175 100644 --- a/templates/registry/registry-pvc.yaml +++ b/templates/registry/registry-pvc.yaml @@ -5,6 +5,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: {{ template "harbor.registry" . }} + namespace: {{ .Release.Namespace | quote }} annotations: {{- range $key, $value := $registry.annotations }} {{ $key }}: {{ $value | quote }} @@ -30,4 +31,4 @@ spec: {{- end }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/registry/registry-secret.yaml b/templates/registry/registry-secret.yaml index e853a9cbe..11ada3b70 100644 --- a/templates/registry/registry-secret.yaml +++ b/templates/registry/registry-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.registry" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque @@ -43,6 +44,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.registry" . }}-htpasswd" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque diff --git a/templates/registry/registry-svc.yaml b/templates/registry/registry-svc.yaml index 749690ea0..d89ae7dca 100644 --- a/templates/registry/registry-svc.yaml +++ b/templates/registry/registry-svc.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "harbor.registry" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} spec: @@ -17,4 +18,4 @@ spec: {{- end }} selector: {{ include "harbor.matchLabels" . | indent 4 }} - component: registry \ No newline at end of file + component: registry diff --git a/templates/registry/registry-tls.yaml b/templates/registry/registry-tls.yaml index 9d1862c41..ec4540c2e 100644 --- a/templates/registry/registry-tls.yaml +++ b/templates/registry/registry-tls.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.registry.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls @@ -12,4 +13,4 @@ data: tls.crt: {{ (required "The \"internalTLS.registry.crt\" is required!" .Values.internalTLS.registry.crt) | b64enc | quote }} tls.key: {{ (required "The \"internalTLS.registry.key\" is required!" .Values.internalTLS.registry.key) | b64enc | quote }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/registry/registryctl-cm.yaml b/templates/registry/registryctl-cm.yaml index 87aa5ffe2..61b2c5e13 100644 --- a/templates/registry/registryctl-cm.yaml +++ b/templates/registry/registryctl-cm.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ template "harbor.registryCtl" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} data: diff --git a/templates/registry/registryctl-secret.yaml b/templates/registry/registryctl-secret.yaml index 70097703e..324a2e03b 100644 --- a/templates/registry/registryctl-secret.yaml +++ b/templates/registry/registryctl-secret.yaml @@ -2,8 +2,9 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.registryCtl" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque data: - {{- template "harbor.traceJaegerPassword" . }} \ No newline at end of file + {{- template "harbor.traceJaegerPassword" . }} diff --git a/templates/trivy/trivy-secret.yaml b/templates/trivy/trivy-secret.yaml index 84652c749..b13f88000 100644 --- a/templates/trivy/trivy-secret.yaml +++ b/templates/trivy/trivy-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "harbor.trivy" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: Opaque diff --git a/templates/trivy/trivy-sts.yaml b/templates/trivy/trivy-sts.yaml index c876ba387..7e34ee9c7 100644 --- a/templates/trivy/trivy-sts.yaml +++ b/templates/trivy/trivy-sts.yaml @@ -4,6 +4,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ template "harbor.trivy" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} component: trivy diff --git a/templates/trivy/trivy-svc.yaml b/templates/trivy/trivy-svc.yaml index 24daf094e..e0ae32070 100644 --- a/templates/trivy/trivy-svc.yaml +++ b/templates/trivy/trivy-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "harbor.trivy" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} spec: diff --git a/templates/trivy/trivy-tls.yaml b/templates/trivy/trivy-tls.yaml index a9c8330c3..58bce4ec5 100644 --- a/templates/trivy/trivy-tls.yaml +++ b/templates/trivy/trivy-tls.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "harbor.internalTLS.trivy.secretName" . }}" + namespace: {{ .Release.Namespace | quote }} labels: {{ include "harbor.labels" . | indent 4 }} type: kubernetes.io/tls