diff --git a/templates/registry/registry-cm.yaml b/templates/registry/registry-cm.yaml index 62bae629f53450896382bde40b35316df3e2ce67..a8942e422c9723c51e4fc6ad65588160a6f97cc8 100644 --- a/templates/registry/registry-cm.yaml +++ b/templates/registry/registry-cm.yaml @@ -12,8 +12,15 @@ data: fields: service: registry storage: + {{- $storage := .Values.registry.storage }} + {{- $type := $storage.type }} + {{- if eq $type "filesystem" }} filesystem: - rootdirectory: /data +{{ toYaml $storage.filesystem | indent 8 }} + {{- else if eq $type "s3" }} + s3: +{{ toYaml $storage.s3 | indent 8 }} + {{- end }} cache: layerinfo: redis maintenance: diff --git a/templates/registry/registry-dpl.yaml b/templates/registry/registry-dpl.yaml index cb56033fa36b162b80278de334cf433cc6ea3c42..941987a48a3e792a4629970ec0afbbcfbbf98131 100644 --- a/templates/registry/registry-dpl.yaml +++ b/templates/registry/registry-dpl.yaml @@ -1,3 +1,4 @@ +{{- $storage := .Values.registry.storage }} apiVersion: apps/v1 kind: Deployment metadata: @@ -49,8 +50,10 @@ spec: - containerPort: 5000 - containerPort: 5001 volumeMounts: + {{- if eq $storage.type "filesystem" }} - name: registry-data mountPath: /data + {{- end }} - name: registry-root-certificate mountPath: /etc/registry/root.crt subPath: tokenServiceRootCertBundle @@ -94,8 +97,10 @@ spec: ports: - containerPort: 8080 volumeMounts: + {{- if eq $storage.type "filesystem" }} - name: registry-data mountPath: /data + {{- end }} - name: registry-config mountPath: /etc/registry/config.yml subPath: config.yml @@ -114,6 +119,7 @@ spec: - name: registry-config configMap: name: "{{ template "harbor.registry" . }}" + {{- if eq $storage.type "filesystem" }} - name: registry-data hostPath: {{- if .Values.registry.hostPath }} @@ -121,6 +127,7 @@ spec: {{- else }} path: /data/{{ .Release.Namespace }}/{{ .Release.Name }}/registry {{- end }} + {{- end }} {{- with .Values.registry.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/values-aliyun.yaml b/values-aliyun.yaml index 434b70d0729266b3ebda9d9501a9ecea247bad7c..84897f1f1f2fa938c7b62d9b3ab893c6a3ac3ed0 100644 --- a/values-aliyun.yaml +++ b/values-aliyun.yaml @@ -58,6 +58,21 @@ registry: memory: 256Mi nodeSelector: harbor: enabled + storage: + # 存储类型,filesystem-本地文件存储,s3-minio s3存储 + type: filesystem + filesystem: + rootdirectory: /data + s3: + accesskey: AKIAIOSFODNN7EXAMPLE + secretkey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + region: us-east-1 + regionendpoint: http://minio.wodcloud.local + bucket: registry + encrypt: false + v4auth: true + chunksize: 5242880 + rootdirectory: / # hostPath , 设置改变存储registry本地路径 # 注释后将使用默认存储位置