diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index b3430a1f3..3e3bfb2fd 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -563,4 +563,4 @@ app: "{{ template "harbor.name" . }}" {{/* Allow KubeVersion to be overridden. */}} {{- define "harbor.ingress.kubeVersion" -}} {{- default .Capabilities.KubeVersion.Version .Values.expose.ingress.kubeVersionOverride -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/templates/registry/registry-cm.yaml b/templates/registry/registry-cm.yaml index 4f7056c38..bd92ad1b3 100644 --- a/templates/registry/registry-cm.yaml +++ b/templates/registry/registry-cm.yaml @@ -153,8 +153,10 @@ data: rootdirectory: {{ $storage.oss.rootdirectory }} {{- end }} {{- end }} + {{- if .Values.redis.enabledForRegistry }} cache: layerinfo: redis + {{- end }} maintenance: uploadpurging: {{- if .Values.registry.upload_purging.enabled }} @@ -169,6 +171,7 @@ data: enabled: true redirect: disable: {{ $storage.disableredirect }} + {{- if .Values.redis.enabledForRegistry }} redis: addr: {{ template "harbor.redis.addr" . }} {{- if eq "redis+sentinel" (include "harbor.redis.scheme" .) }} @@ -185,6 +188,7 @@ data: maxidle: 100 maxactive: 500 idletimeout: 60s + {{- end }} http: addr: :{{ template "harbor.registry.containerPort" . }} relativeurls: {{ .Values.registry.relativeurls }} diff --git a/values.yaml b/values.yaml index 3c4e87081..1a17402cc 100644 --- a/values.yaml +++ b/values.yaml @@ -896,6 +896,11 @@ redis: # if external Redis is used, set "type" to "external" # and fill the connection information in "external" section type: internal + # If redis should be used by the registry. + # The registry has some bugs related to cache invalidation when deleting + # images, see https://github.com/distribution/distribution/issues/4269. If you + # encounter this bug, setting this value to false may help. + enabledForRegistry: true internal: image: repository: goharbor/redis-photon