Add gcrurl env var to addon deployment and configuration

pull/1436/head
Teddy Schmitz 2017-05-02 12:14:17 +08:00
parent b0054c4ccd
commit 5f6511c73c
2 changed files with 16 additions and 0 deletions

View File

@ -52,6 +52,7 @@ var addonsConfigureCmd = &cobra.Command{
dockerServer := "changeme"
dockerUser := "changeme"
dockerPass := "changeme"
gcrURL := "https://gcr.io"
enableAWSECR := AskForYesNoConfirmation("\nDo you want to enable AWS Elastic Container Registry?", posResponses, negResponses)
if enableAWSECR {
@ -64,6 +65,11 @@ var addonsConfigureCmd = &cobra.Command{
enableGCR := AskForYesNoConfirmation("\nDo you want to enable Google Container Registry?", posResponses, negResponses)
if enableGCR {
gcrPath := AskForStaticValue("-- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):")
gcrchangeURL := AskForYesNoConfirmation("-- Do you want to change the GCR URL (Default https://gcr.io)?", posResponses, negResponses)
if gcrchangeURL {
gcrURL = AskForStaticValue("-- Enter GCR URL (e.g. https://asia.gcr.io):")
}
// Read file from disk
dat, err := ioutil.ReadFile(gcrPath)
@ -108,6 +114,7 @@ var addonsConfigureCmd = &cobra.Command{
"registry-creds-gcr",
map[string]string{
"application_default_credentials.json": gcrApplicationDefaultCredentials,
"gcrurl": gcrURL,
},
map[string]string{
"app": "registry-creds",

View File

@ -60,6 +60,11 @@ spec:
secretKeyRef:
name: registry-creds-dpr
key: DOCKER_PRIVATE_REGISTRY_USER
- name: gcrurl
valueFrom:
secretKeyRef:
name: registry-creds-gcr
key: gcrurl
volumeMounts:
- name: gcr-creds
mountPath: "/root/.config/gcloud"
@ -68,3 +73,7 @@ spec:
- name: gcr-creds
secret:
secretName: registry-creds-gcr
items:
- key: "application_default_credentials.json"
path: "application_default_credentials.json"