diff --git a/README.md b/README.md index 622ec9f..e100b7d 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ their default values. | `secrets.swift.password` | Password for Swift configuration | `nil` | | `secrets.haSharedSecret` | Shared secret for Registry | `nil` | | `configData` | Configuration hash for docker | `nil` | +| `configPath` | Configuration mount point in docker, `/etc/docker/registry` for registry version 2, `/etc/distribution` for version 3 | `/etc/docker/registry` | | `s3.region` | S3 region | `nil` | | `s3.regionEndpoint` | S3 region endpoint | `nil` | | `s3.bucket` | S3 bucket name | `nil` | diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index d9d7531..f7681bb 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -148,7 +148,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "docker-registry.volumeMounts" -}} - name: "{{ template "docker-registry.fullname" . }}-config" - mountPath: "/etc/docker/registry" + mountPath: {{ .Values.configPath }} {{- if .Values.secrets.htpasswd }} - name: auth diff --git a/templates/cronjob.yaml b/templates/cronjob.yaml index e920776..a541959 100644 --- a/templates/cronjob.yaml +++ b/templates/cronjob.yaml @@ -58,7 +58,7 @@ spec: - /bin/registry - garbage-collect - --delete-untagged={{ .Values.garbageCollect.deleteUntagged }} - - /etc/docker/registry/config.yml + - {{ .Values.configPath }}/config.yml {{- if .Values.garbageCollect.resources }} resources: {{- toYaml .Values.garbageCollect.resources | nindent 16 }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index dff79cb..a8ef2fc 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -60,7 +60,7 @@ spec: command: - /bin/registry - serve - - /etc/docker/registry/config.yml + - {{ .Values.configPath }}/config.yml ports: - containerPort: 5000 {{- if .Values.metrics.enabled }} diff --git a/values.yaml b/values.yaml index ef8f041..b8c5ce2 100644 --- a/values.yaml +++ b/values.yaml @@ -19,7 +19,7 @@ serviceAccount: image: repository: registry - tag: 2.8.1 + tag: 3.0.0 pullPolicy: IfNotPresent # imagePullSecrets: # - name: docker @@ -133,6 +133,7 @@ metrics: labels: {} rules: {} +configPath: /etc/distribution configData: version: 0.1 log: @@ -176,6 +177,7 @@ securityContext: fsGroupChangePolicy: Always sysctls: [] supplementalGroups: [] + runAsUser: 1000 fsGroup: 1000 priorityClassName: ""