Skip to content

Commit

Permalink
Allow disabling redis in registry
Browse files Browse the repository at this point in the history
There are bugs in the registry with regards to cache invalidation when
deleting an image that can lead to some really problematic issues. See
distribution/distribution#4269.

To work around that problem, add a new field to allow disabling redis in
the registry.

Signed-off-by: roblabla <unfiltered@roblab.la>
  • Loading branch information
roblabla committed Feb 22, 2024
1 parent 54979d8 commit b805ea5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/_helpers.tpl
Expand Up @@ -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 -}}
{{- end -}}
4 changes: 4 additions & 0 deletions templates/registry/registry-cm.yaml
Expand Up @@ -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 }}
Expand All @@ -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" .) }}
Expand All @@ -185,6 +188,7 @@ data:
maxidle: 100
maxactive: 500
idletimeout: 60s
{{- end }}
http:
addr: :{{ template "harbor.registry.containerPort" . }}
relativeurls: {{ .Values.registry.relativeurls }}
Expand Down
5 changes: 5 additions & 0 deletions values.yaml
Expand Up @@ -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
Expand Down

0 comments on commit b805ea5

Please sign in to comment.