From 5772a61e5d1b8cc38a976b5906507e53d6ba6755 Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Fri, 27 Jul 2018 13:24:22 +0800 Subject: [PATCH] Fix misc issues of Harbor chart 1. Read value of storage driver from values.yaml for adminserver 2. Set Redis as UI cache 3. Set Redis as registry cache --- .../harbor/templates/adminserver/adminserver-cm.yaml | 2 +- contrib/helm/harbor/templates/registry/registry-cm.yaml | 9 ++++----- contrib/helm/harbor/templates/ui/ui-dpl.yaml | 2 ++ contrib/helm/harbor/values.yaml | 4 ---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/contrib/helm/harbor/templates/adminserver/adminserver-cm.yaml b/contrib/helm/harbor/templates/adminserver/adminserver-cm.yaml index 5de07836e..887ab477d 100644 --- a/contrib/helm/harbor/templates/adminserver/adminserver-cm.yaml +++ b/contrib/helm/harbor/templates/adminserver/adminserver-cm.yaml @@ -55,4 +55,4 @@ data: UAA_CLIENTID: "" UAA_CLIENTSECRET: "" UAA_VERIFY_CERT: "True" - REGISTRY_STORAGE_PROVIDER_NAME: "filesystem" + REGISTRY_STORAGE_PROVIDER_NAME: "{{ .Values.registry.storage.type }}" diff --git a/contrib/helm/harbor/templates/registry/registry-cm.yaml b/contrib/helm/harbor/templates/registry/registry-cm.yaml index 254025fd3..d579f1cf4 100644 --- a/contrib/helm/harbor/templates/registry/registry-cm.yaml +++ b/contrib/helm/harbor/templates/registry/registry-cm.yaml @@ -130,16 +130,16 @@ data: {{- end }} {{- end }} cache: - layerinfo: inmemory + layerinfo: redis maintenance: uploadpurging: enabled: false delete: enabled: true - {{- if .Values.registry.redis }} redis: -{{ toYaml .Values.registry.redis | indent 6 }} - {{- end }} + addr: "{{ template "harbor.redis.host" . }}:{{ template "harbor.redis.port" . }}" + password: {{ template "harbor.redis.password" . }} + db: {{ template "harbor.redis.databaseIndex" . }} http: addr: :5000 # set via environment variable @@ -152,7 +152,6 @@ data: realm: "{{ template "harbor.externalURL" . }}/service/token" rootcertbundle: /etc/registry/root.crt service: harbor-registry - notifications: endpoints: - name: harbor diff --git a/contrib/helm/harbor/templates/ui/ui-dpl.yaml b/contrib/helm/harbor/templates/ui/ui-dpl.yaml index fd9ac06a3..43cc007de 100644 --- a/contrib/helm/harbor/templates/ui/ui-dpl.yaml +++ b/contrib/helm/harbor/templates/ui/ui-dpl.yaml @@ -28,6 +28,8 @@ spec: secretKeyRef: name: "{{ template "harbor.fullname" . }}-ui" key: jobserviceSecret + - name: _REDIS_URL + value: {{ template "harbor.redisForUI" . }} - name: GODEBUG value: netdns=cgo - name: LOG_LEVEL diff --git a/contrib/helm/harbor/values.yaml b/contrib/helm/harbor/values.yaml index 9b5634a4f..8dd928a8d 100644 --- a/contrib/helm/harbor/values.yaml +++ b/contrib/helm/harbor/values.yaml @@ -291,10 +291,6 @@ registry: # requests: # memory: 256Mi # cpu: 100m - ## Enable the redis caching in the registry - #redis: - # addr: "redis-host:6379" - # db: 2 nodeSelector: {} tolerations: [] affinity: {}