From 15ff869d17c718565eb82e0309cbc37dd9fa0d10 Mon Sep 17 00:00:00 2001 From: Christian Nadeau Date: Mon, 15 Oct 2018 13:19:01 -0400 Subject: [PATCH] Added docker-registry azure storage support (#7869) * Adds the ability to define 'azure' as storage secrets configurations in values.yml: * accountName * accountKey * container which translates to secret keys: azureAccountName azureAccountKey azureContainer Signed-off-by: Christian Nadeau --- stable/docker-registry/Chart.yaml | 2 +- stable/docker-registry/templates/deployment.yaml | 16 ++++++++++++++++ stable/docker-registry/templates/secret.yaml | 9 ++++++++- stable/docker-registry/values.yaml | 5 +++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/stable/docker-registry/Chart.yaml b/stable/docker-registry/Chart.yaml index 3acc23febd..093e055841 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.5.3 +version: 1.6.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/templates/deployment.yaml b/stable/docker-registry/templates/deployment.yaml index 8ebff0e0ba..669a6a4ac0 100644 --- a/stable/docker-registry/templates/deployment.yaml +++ b/stable/docker-registry/templates/deployment.yaml @@ -86,6 +86,22 @@ spec: {{- if eq .Values.storage "filesystem" }} - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY value: "/var/lib/registry" +{{- else if eq .Values.storage "azure" }} + - name: REGISTRY_STORAGE_AZURE_ACCOUNTNAME + valueFrom: + secretKeyRef: + name: {{ template "docker-registry.fullname" . }}-secret + key: azureAccountName + - name: REGISTRY_STORAGE_AZURE_ACCOUNTKEY + valueFrom: + secretKeyRef: + name: {{ template "docker-registry.fullname" . }}-secret + key: azureAccountKey + - name: REGISTRY_STORAGE_AZURE_CONTAINER + valueFrom: + secretKeyRef: + name: {{ template "docker-registry.fullname" . }}-secret + key: azureContainer {{- else if eq .Values.storage "s3" }} {{- if and .Values.secrets.s3.secretKey .Values.secrets.s3.accessKey }} - name: REGISTRY_STORAGE_S3_ACCESSKEY diff --git a/stable/docker-registry/templates/secret.yaml b/stable/docker-registry/templates/secret.yaml index 892a2da7c1..c22fd3076f 100644 --- a/stable/docker-registry/templates/secret.yaml +++ b/stable/docker-registry/templates/secret.yaml @@ -17,7 +17,14 @@ data: {{- else }} haSharedSecret: {{ randAlphaNum 16 | b64enc | quote }} {{- end }} - {{- if eq .Values.storage "s3" }} + + {{- if eq .Values.storage "azure" }} + {{- if and .Values.secrets.azure.accountName .Values.secrets.azure.accountKey .Values.secrets.azure.container }} + azureAccountName: {{ .Values.secrets.azure.accountName | b64enc | quote }} + azureAccountKey: {{ .Values.secrets.azure.accountKey | b64enc | quote }} + azureContainer: {{ .Values.secrets.azure.container | b64enc | quote }} + {{- end }} + {{- else if eq .Values.storage "s3" }} {{- if and .Values.secrets.s3.secretKey .Values.secrets.s3.accessKey }} s3AccessKey: {{ .Values.secrets.s3.accessKey | b64enc | quote }} s3SecretKey: {{ .Values.secrets.s3.secretKey | b64enc | quote }} diff --git a/stable/docker-registry/values.yaml b/stable/docker-registry/values.yaml index ad9c5b95d9..1931cb0de2 100644 --- a/stable/docker-registry/values.yaml +++ b/stable/docker-registry/values.yaml @@ -64,6 +64,11 @@ storage: filesystem secrets: haSharedSecret: "" htpasswd: "" +# Secrets for Azure +# azure: +# accountName: "" +# accountKey: "" +# container: "" # Secrets for S3 access and secret keys # s3: # accessKey: ""