diff --git a/cmd/minikube/cmd/config/configure.go b/cmd/minikube/cmd/config/configure.go index b51d240063b1..412fa1204d1f 100644 --- a/cmd/minikube/cmd/config/configure.go +++ b/cmd/minikube/cmd/config/configure.go @@ -53,6 +53,9 @@ var addonsConfigureCmd = &cobra.Command{ dockerUser := "changeme" dockerPass := "changeme" gcrURL := "https://gcr.io" + acrURL := "changeme" + acrClientID := "changeme" + acrPassword := "changeme" enableAWSECR := AskForYesNoConfirmation("\nDo you want to enable AWS Elastic Container Registry?", posResponses, negResponses) if enableAWSECR { @@ -90,6 +93,13 @@ var addonsConfigureCmd = &cobra.Command{ dockerPass = AskForPasswordValue("-- Enter docker registry password: ") } + enableACR := AskForYesNoConfirmation("\nDo you want to enable Azure Container Registry?", posResponses, negResponses) + if enableACR { + acrURL = AskForStaticValue("-- Enter Azure Container Registry (ACR) URL: ") + acrClientID = AskForStaticValue("-- Enter client ID (service principal ID) to access ACR: ") + acrPassword = AskForPasswordValue("-- Enter service principal password to access Azure Container Registry: ") + } + // Create ECR Secret err := service.CreateSecret( "kube-system", @@ -148,6 +158,26 @@ var addonsConfigureCmd = &cobra.Command{ if err != nil { out.WarningT("ERROR creating `registry-creds-dpr` secret") } + + // Create Azure Container Registry Secret + err = service.CreateSecret( + "kube-system", + "registry-creds-acr", + map[string]string{ + "ACR_URL": acrURL, + "ACR_CLIENT_ID": acrClientID, + "ACR_PASSWORD": acrPassword, + }, + map[string]string{ + "app": "registry-creds", + "cloud": "acr", + "kubernetes.io/minikube-addons": "registry-creds", + }) + + if err != nil { + out.WarningT("ERROR creating `registry-creds-acr` secret") + } + default: out.FailureT("{{.name}} has no available configuration options", out.V{"name": addon}) return diff --git a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl index 8d3c3f1fd480..4af7e7400ae2 100644 --- a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl +++ b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl @@ -18,7 +18,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: upmcenterprises/registry-creds:1.9 + - image: upmcenterprises/registry-creds:1.10 name: registry-creds imagePullPolicy: Always env: @@ -77,6 +77,21 @@ spec: secretKeyRef: name: registry-creds-gcr key: gcrurl + - name: ACR_PASSWORD + valueFrom: + secretKeyRef: + name: registry-creds-acr + key: ACR_PASSWORD + - name: ACR_URL + valueFrom: + secretKeyRef: + name: registry-creds-acr + key: ACR_URL + - name: ACR_CLIENT_ID + valueFrom: + secretKeyRef: + name: registry-creds-acr + key: ACR_CLIENT_ID volumeMounts: - name: gcr-creds mountPath: "/root/.config/gcloud" diff --git a/site/content/en/docs/Tasks/Registry/private.md b/site/content/en/docs/Tasks/Registry/private.md index b2a835e7e84a..270ad665e4e0 100644 --- a/site/content/en/docs/Tasks/Registry/private.md +++ b/site/content/en/docs/Tasks/Registry/private.md @@ -2,13 +2,13 @@ title: "Private" linkTitle: "Private" weight: 6 -date: 2019-08-01 +date: 2020-01-14 description: > How to use a private registry within minikube --- -**GCR/ECR/Docker**: minikube has an addon, `registry-creds` which maps credentials into minikube to support pulling from Google Container Registry (GCR), Amazon's EC2 Container Registry (ECR), and Private Docker registries. You will need to run `minikube addons configure registry-creds` and `minikube addons enable registry-creds` to get up and running. An example of this is below: +**GCR/ECR/ACR/Docker**: minikube has an addon, `registry-creds` which maps credentials into minikube to support pulling from Google Container Registry (GCR), Amazon's EC2 Container Registry (ECR), Azure Container Registry (ACR), and Private Docker registries. You will need to run `minikube addons configure registry-creds` and `minikube addons enable registry-creds` to get up and running. An example of this is below: ```shell $ minikube addons configure registry-creds @@ -18,6 +18,8 @@ Do you want to enable Google Container Registry? [y/n]: y -- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):/home/user/.config/gcloud/application_default_credentials.json Do you want to enable Docker Registry? [y/n]: n + +Do you want to enable Azure Container Registry? [y/n]: n registry-creds was successfully configured $ minikube addons enable registry-creds ```