From 0527bd0ce524906eabc5805fb5547b0baede3322 Mon Sep 17 00:00:00 2001 From: shucheng Date: Wed, 29 May 2019 02:12:08 +0800 Subject: [PATCH] update --- templates/registry/registry-cm.yaml | 9 ++++++++- templates/registry/registry-dpl.yaml | 7 +++++++ values-aliyun.yaml | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/templates/registry/registry-cm.yaml b/templates/registry/registry-cm.yaml index 62bae62..a8942e4 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 cb56033..941987a 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 434b70d..84897f1 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本地路径 # 注释后将使用默认存储位置 -- 2.26.0