Commit 0527bd0c authored by 舒成's avatar 舒成

update

parent c078824d
...@@ -12,8 +12,15 @@ data: ...@@ -12,8 +12,15 @@ data:
fields: fields:
service: registry service: registry
storage: storage:
{{- $storage := .Values.registry.storage }}
{{- $type := $storage.type }}
{{- if eq $type "filesystem" }}
filesystem: filesystem:
rootdirectory: /data {{ toYaml $storage.filesystem | indent 8 }}
{{- else if eq $type "s3" }}
s3:
{{ toYaml $storage.s3 | indent 8 }}
{{- end }}
cache: cache:
layerinfo: redis layerinfo: redis
maintenance: maintenance:
......
{{- $storage := .Values.registry.storage }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -49,8 +50,10 @@ spec: ...@@ -49,8 +50,10 @@ spec:
- containerPort: 5000 - containerPort: 5000
- containerPort: 5001 - containerPort: 5001
volumeMounts: volumeMounts:
{{- if eq $storage.type "filesystem" }}
- name: registry-data - name: registry-data
mountPath: /data mountPath: /data
{{- end }}
- name: registry-root-certificate - name: registry-root-certificate
mountPath: /etc/registry/root.crt mountPath: /etc/registry/root.crt
subPath: tokenServiceRootCertBundle subPath: tokenServiceRootCertBundle
...@@ -94,8 +97,10 @@ spec: ...@@ -94,8 +97,10 @@ spec:
ports: ports:
- containerPort: 8080 - containerPort: 8080
volumeMounts: volumeMounts:
{{- if eq $storage.type "filesystem" }}
- name: registry-data - name: registry-data
mountPath: /data mountPath: /data
{{- end }}
- name: registry-config - name: registry-config
mountPath: /etc/registry/config.yml mountPath: /etc/registry/config.yml
subPath: config.yml subPath: config.yml
...@@ -114,6 +119,7 @@ spec: ...@@ -114,6 +119,7 @@ spec:
- name: registry-config - name: registry-config
configMap: configMap:
name: "{{ template "harbor.registry" . }}" name: "{{ template "harbor.registry" . }}"
{{- if eq $storage.type "filesystem" }}
- name: registry-data - name: registry-data
hostPath: hostPath:
{{- if .Values.registry.hostPath }} {{- if .Values.registry.hostPath }}
...@@ -121,6 +127,7 @@ spec: ...@@ -121,6 +127,7 @@ spec:
{{- else }} {{- else }}
path: /data/{{ .Release.Namespace }}/{{ .Release.Name }}/registry path: /data/{{ .Release.Namespace }}/{{ .Release.Name }}/registry
{{- end }} {{- end }}
{{- end }}
{{- with .Values.registry.nodeSelector }} {{- with .Values.registry.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
......
...@@ -58,6 +58,21 @@ registry: ...@@ -58,6 +58,21 @@ registry:
memory: 256Mi memory: 256Mi
nodeSelector: nodeSelector:
harbor: enabled 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本地路径 # hostPath , 设置改变存储registry本地路径
# 注释后将使用默认存储位置 # 注释后将使用默认存储位置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment