From 753273e6d2e06f656e7eb8730fbbda6da13a495f Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Wed, 16 May 2018 12:06:29 -0400 Subject: [PATCH] [stable/docker-registry] Add swift storage support to docker-registry (#5601) * Add swift storage support to docker-registry * Add new options to readme --- stable/docker-registry/Chart.yaml | 2 +- stable/docker-registry/README.md | 4 ++++ stable/docker-registry/templates/deployment.yaml | 15 +++++++++++++++ stable/docker-registry/templates/secret.yaml | 9 +++++++-- stable/docker-registry/values.yaml | 9 +++++++++ 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/stable/docker-registry/Chart.yaml b/stable/docker-registry/Chart.yaml index 378808724c..367738c4c9 100644 --- a/stable/docker-registry/Chart.yaml +++ b/stable/docker-registry/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A Helm chart for Docker Registry name: docker-registry -version: 1.3.1 +version: 1.4.0 appVersion: 2.6.2 home: https://hub.docker.com/_/registry/ icon: https://hub.docker.com/public/images/logos/mini-logo.svg diff --git a/stable/docker-registry/README.md b/stable/docker-registry/README.md index 6c534e1978..0299211951 100644 --- a/stable/docker-registry/README.md +++ b/stable/docker-registry/README.md @@ -49,12 +49,16 @@ their default values. | `secrets.htpasswd` | Htpasswd authentication | `nil` | | `secrets.s3.accessKey` | Access Key for S3 configuration | `nil` | | `secrets.s3.secretKey` | Secret Key for S3 configuration | `nil` | +| `secrets.swift.username` | Username for Swift configuration | `nil` | +| `secrets.swift.password` | Password for Swift configuration | `nil` | | `haSharedSecret` | Shared secret for Registry | `nil` | | `configData` | Configuration hash for docker | `nil` | | `s3.region` | S3 region | `nil` | | `s3.bucket` | S3 bucket name | `nil` | | `s3.encrypt` | Store images in encrypted format | `nil` | | `s3.secure` | Use HTTPS | `nil` | +| `swift.authurl` | Swift authurl | `nil` | +| `swift.container` | Swift container | `nil` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/stable/docker-registry/templates/deployment.yaml b/stable/docker-registry/templates/deployment.yaml index 344ae00618..ce75bc94b4 100644 --- a/stable/docker-registry/templates/deployment.yaml +++ b/stable/docker-registry/templates/deployment.yaml @@ -97,6 +97,21 @@ spec: - name: REGISTRY_STORAGE_S3_SECURE value: {{ .Values.s3.secure | quote }} {{- end }} +{{- else if eq .Values.storage "swift" }} + - name: REGISTRY_STORAGE_SWIFT_AUTHURL + value: {{ required ".Values.swift.authurl is required" .Values.swift.authurl }} + - name: REGISTRY_STORAGE_SWIFT_USERNAME + valueFrom: + secretKeyRef: + name: {{ template "docker-registry.fullname" . }}-secret + key: swiftUsername + - name: REGISTRY_STORAGE_SWIFT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "docker-registry.fullname" . }}-secret + key: swiftPassword + - name: REGISTRY_STORAGE_SWIFT_CONTAINER + value: {{ required ".Values.swift.container is required" .Values.swift.container }} {{- end }} volumeMounts: {{- if .Values.secrets.htpasswd }} diff --git a/stable/docker-registry/templates/secret.yaml b/stable/docker-registry/templates/secret.yaml index 37f0134c9b..892a2da7c1 100644 --- a/stable/docker-registry/templates/secret.yaml +++ b/stable/docker-registry/templates/secret.yaml @@ -18,8 +18,13 @@ data: haSharedSecret: {{ randAlphaNum 16 | b64enc | quote }} {{- end }} {{- if eq .Values.storage "s3" }} - {{- if and .Values.secrets.s3.secretKey .Values.secrets.s3.accessKey }} + {{- if and .Values.secrets.s3.secretKey .Values.secrets.s3.accessKey }} s3AccessKey: {{ .Values.secrets.s3.accessKey | b64enc | quote }} s3SecretKey: {{ .Values.secrets.s3.secretKey | b64enc | quote }} - {{- end }} + {{- end }} + {{- else if eq .Values.storage "swift" }} + {{- if and .Values.secrets.swift.username .Values.secrets.swift.password }} + swiftUsername: {{ .Values.secrets.swift.username | b64enc | quote }} + swiftPassword: {{ .Values.secrets.swift.password | b64enc | quote }} + {{- end }} {{- end }} diff --git a/stable/docker-registry/values.yaml b/stable/docker-registry/values.yaml index e585d2fd68..45d5145561 100644 --- a/stable/docker-registry/values.yaml +++ b/stable/docker-registry/values.yaml @@ -66,6 +66,10 @@ secrets: # s3: # accessKey: "" # secretKey: "" +# Secrets for Swift username and password +# swift: +# username: "" +# password: "" # Options for s3 storage type: # s3: @@ -74,6 +78,11 @@ secrets: # encrypt: false # secure: true +# Options for swift storage type: +# swift: +# authurl: http://swift.example.com/ +# container: my-container + configData: version: 0.1 log: