From b949034e1a699dded937efdad2daccf45e33db24 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Fri, 8 Jan 2021 14:22:20 +0800 Subject: [PATCH 01/11] Manage addon images in code, support custom addon images Signed-off-by: Ling Samuel --- cmd/minikube/cmd/config/enable.go | 8 +++ cmd/minikube/cmd/config/images.go | 69 ++++++++++++++++++++++ deploy/addons/ingress/ingress-dp.yaml.tmpl | 6 +- pkg/addons/addons.go | 2 +- pkg/minikube/assets/addons.go | 36 ++++++++++- pkg/minikube/config/config.go | 2 + 6 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 cmd/minikube/cmd/config/images.go diff --git a/cmd/minikube/cmd/config/enable.go b/cmd/minikube/cmd/config/enable.go index d16597f4bd2e..fd593c82cd01 100644 --- a/cmd/minikube/cmd/config/enable.go +++ b/cmd/minikube/cmd/config/enable.go @@ -20,7 +20,9 @@ import ( "fmt" "github.com/spf13/cobra" + "github.com/spf13/viper" "k8s.io/minikube/pkg/addons" + "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/out" @@ -42,6 +44,7 @@ var addonsEnableCmd = &cobra.Command{ out.Step(style.Waiting, "enable metrics-server addon instead of heapster addon because heapster is deprecated") addon = "metrics-server" } + viper.Set(config.AddonImages, images) err := addons.SetAndSave(ClusterFlagValue(), addon, "true") if err != nil { exit.Error(reason.InternalEnable, "enable failed", err) @@ -63,6 +66,11 @@ var addonsEnableCmd = &cobra.Command{ }, } +var ( + images string +) + func init() { + addonsEnableCmd.Flags().StringVar(&images, "images", "", "Alpha feature. Image names used by this addon. Divided by comma.") AddonsCmd.AddCommand(addonsEnableCmd) } diff --git a/cmd/minikube/cmd/config/images.go b/cmd/minikube/cmd/config/images.go new file mode 100644 index 000000000000..ac63fea70ee3 --- /dev/null +++ b/cmd/minikube/cmd/config/images.go @@ -0,0 +1,69 @@ +/* +Copyright 2016 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import ( + "os" + + "github.com/olekukonko/tablewriter" + "github.com/spf13/cobra" + "k8s.io/minikube/pkg/minikube/assets" + "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/out" + "k8s.io/minikube/pkg/minikube/reason" +) + +var addonsImagesCmd = &cobra.Command{ + Use: "images ADDON_NAME", + Short: "Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list", + Long: "Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list", + Run: func(cmd *cobra.Command, args []string) { + if len(args) != 1 { + exit.Message(reason.Usage, "usage: minikube addons configure ADDON_NAME") + } + + addon := args[0] + // allows for additional prompting of information when enabling addons + if conf, ok := assets.Addons[addon]; ok { + if conf.Images != nil { + out.Infof("{{.name}} has following images:", out.V{"name": addon}) + + var tData [][]string + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"Image Name", "Default"}) + table.SetAutoFormatHeaders(true) + table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true}) + table.SetCenterSeparator("|") + + for imageName, defaultImage := range conf.Images { + tData = append(tData, []string{imageName, defaultImage}) + } + + table.AppendBulk(tData) + table.Render() + } else { + out.Infof("{{.name}} has not been implemented yet", out.V{"name": addon}) + } + } else { + out.FailureT("No such addon {{.name}}", out.V{"name": addon}) + } + }, +} + +func init() { + AddonsCmd.AddCommand(addonsImagesCmd) +} diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index fda40ff2bae0..81d02d23ec0a 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -49,7 +49,7 @@ spec: serviceAccountName: ingress-nginx containers: - name: controller - image: {{default "us.gcr.io/k8s-artifacts-prod/ingress-nginx" .ImageRepository}}/controller:v0.40.2 + image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{default "ingress-nginx/controller:v0.40.2" .Images.IngressController}} imagePullPolicy: IfNotPresent lifecycle: preStop: @@ -220,7 +220,7 @@ spec: spec: containers: - name: create - image: {{default "jettech" .ImageRepository}}/kube-webhook-certgen:v1.2.2 + image: {{default "jettech" .ImageRepository}}/{{default "kube-webhook-certgen:v1.2.2" .Images.KubeWebhookCertgenCreate}} imagePullPolicy: IfNotPresent args: - create @@ -255,7 +255,7 @@ spec: spec: containers: - name: patch - image: {{default "jettech" .ImageRepository}}/kube-webhook-certgen:v1.3.0 + image: {{default "jettech" .ImageRepository}}/{{default "kube-webhook-certgen:v1.3.0" .Images.KubeWebhookCertgenPatch}} imagePullPolicy: args: - patch diff --git a/pkg/addons/addons.go b/pkg/addons/addons.go index 3600016c6a79..c8918faa77e0 100644 --- a/pkg/addons/addons.go +++ b/pkg/addons/addons.go @@ -209,7 +209,7 @@ https://github.com/kubernetes/minikube/issues/7332`, out.V{"driver_name": cc.Dri return errors.Wrap(err, "command runner") } - data := assets.GenerateTemplateData(cc.KubernetesConfig) + data := assets.GenerateTemplateData(addon, cc.KubernetesConfig) return enableOrDisableAddonInternal(cc, addon, cmd, data, enable) } diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 85aa09d225e5..ebb7f6878e7f 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -18,9 +18,12 @@ package assets import ( "runtime" + "strings" + "github.com/spf13/viper" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" + "k8s.io/minikube/pkg/minikube/out" "k8s.io/minikube/pkg/minikube/vmpath" "k8s.io/minikube/pkg/version" ) @@ -30,6 +33,7 @@ type Addon struct { Assets []*BinAsset enabled bool addonName string + Images map[string]string } // NewAddon creates a new Addon @@ -58,6 +62,11 @@ func (a *Addon) IsEnabled(cc *config.ClusterConfig) bool { return a.enabled } +func (a *Addon) setImages(images map[string]string) *Addon { + a.Images = images + return a +} + // Addons is the list of addons // TODO: Make dynamically loadable: move this data to a .yaml file within each addon directory var Addons = map[string]*Addon{ @@ -165,7 +174,11 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "ingress-dp.yaml", "0640"), - }, false, "ingress"), + }, false, "ingress").setImages(map[string]string{ + "IngressController": "ingress-nginx/controller:v0.40.2", + "KubeWebhookCertgenCreate": "kube-webhook-certgen:v1.2.2", + "KubeWebhookCertgenPatch": "kube-webhook-certgen:v1.3.0", + }), "istio-provisioner": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/istio-provisioner/istio-operator.yaml.tmpl", @@ -474,7 +487,7 @@ var Addons = map[string]*Addon{ } // GenerateTemplateData generates template data for template assets -func GenerateTemplateData(cfg config.KubernetesConfig) interface{} { +func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} { a := runtime.GOARCH // Some legacy docker images still need the -arch suffix @@ -491,6 +504,7 @@ func GenerateTemplateData(cfg config.KubernetesConfig) interface{} { LoadBalancerEndIP string CustomIngressCert string StorageProvisionerVersion string + Images map[string]string }{ Arch: a, ExoticArch: ea, @@ -499,6 +513,24 @@ func GenerateTemplateData(cfg config.KubernetesConfig) interface{} { LoadBalancerEndIP: cfg.LoadBalancerEndIP, CustomIngressCert: cfg.CustomIngressCert, StorageProvisionerVersion: version.GetStorageProvisionerVersion(), + Images: addon.Images, + } + + if opts.Images == nil { + opts.Images = make(map[string]string) // Avoid nil access when rendering + } + + images := viper.GetString(config.AddonImages) + for _, image := range strings.Split(images, ",") { + vals := strings.Split(image, "=") + if len(vals) != 2 { + out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image}) + continue + } + if defaultImage, ok := opts.Images[vals[0]]; ok { + out.Infof("Using {{.image}} instead default image {{.default}}", out.V{"image": vals[1], "name": defaultImage}) + } + opts.Images[vals[0]] = vals[1] } return opts diff --git a/pkg/minikube/config/config.go b/pkg/minikube/config/config.go index ee7ff39b7f22..09bed9ced2be 100644 --- a/pkg/minikube/config/config.go +++ b/pkg/minikube/config/config.go @@ -50,6 +50,8 @@ const ( ShowBootstrapperDeprecationNotification = "ShowBootstrapperDeprecationNotification" // UserFlag is the key for the global user flag (ex. --user=user1) UserFlag = "user" + // AddonImages stores custom addon images config + AddonImages = "addon-images" ) var ( From a49d91524b2be44c8b803edd373e1941563cf087 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Fri, 8 Jan 2021 14:42:27 +0800 Subject: [PATCH 02/11] update docs Signed-off-by: Ling Samuel --- site/content/en/docs/commands/addons.md | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/site/content/en/docs/commands/addons.md b/site/content/en/docs/commands/addons.md index 5abbd05ffc3b..58e4b318ac30 100644 --- a/site/content/en/docs/commands/addons.md +++ b/site/content/en/docs/commands/addons.md @@ -119,6 +119,12 @@ Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable minikube addons enable ADDON_NAME [flags] ``` +### Options + +``` + --images string Alpha feature. Image names used by this addon. Divided by comma. +``` + ### Options inherited from parent commands ``` @@ -176,6 +182,39 @@ minikube addons help [command] [flags] --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging ``` +## minikube addons images + +Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list + +### Synopsis + +Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list + +```shell +minikube addons images ADDON_NAME [flags] +``` + +### Options inherited from parent commands + +``` + --add_dir_header If true, adds the file directory to the header of the log messages + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm") + -h, --help + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --log_file string If non-empty, use this log file + --log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) + --logtostderr log to standard error instead of files + --one_output If true, only write logs to their native severity level (vs also writing to each lower severity level + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --skip_headers If true, avoid header prefixes in the log messages + --skip_log_headers If true, avoid headers when opening log files + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level number for the log level verbosity + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + ## minikube addons list Lists all available minikube addons as well as their current statuses (enabled/disabled) From 7b2d1a6838957b119ac2608be4121be1553a34f7 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Fri, 8 Jan 2021 14:51:52 +0800 Subject: [PATCH 03/11] Remove default image from yaml, fix empty images warning Signed-off-by: Ling Samuel --- deploy/addons/ingress/ingress-dp.yaml.tmpl | 6 +++--- pkg/minikube/assets/addons.go | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index 81d02d23ec0a..8d184dd13010 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -49,7 +49,7 @@ spec: serviceAccountName: ingress-nginx containers: - name: controller - image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{default "ingress-nginx/controller:v0.40.2" .Images.IngressController}} + image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{.Images.IngressController}} imagePullPolicy: IfNotPresent lifecycle: preStop: @@ -220,7 +220,7 @@ spec: spec: containers: - name: create - image: {{default "jettech" .ImageRepository}}/{{default "kube-webhook-certgen:v1.2.2" .Images.KubeWebhookCertgenCreate}} + image: {{default "jettech" .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}} imagePullPolicy: IfNotPresent args: - create @@ -255,7 +255,7 @@ spec: spec: containers: - name: patch - image: {{default "jettech" .ImageRepository}}/{{default "kube-webhook-certgen:v1.3.0" .Images.KubeWebhookCertgenPatch}} + image: {{default "jettech" .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}} imagePullPolicy: args: - patch diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index ebb7f6878e7f..e0c99bfefe1c 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -521,16 +521,18 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} } images := viper.GetString(config.AddonImages) - for _, image := range strings.Split(images, ",") { - vals := strings.Split(image, "=") - if len(vals) != 2 { - out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image}) - continue + if images != "" { + for _, image := range strings.Split(images, ",") { + vals := strings.Split(image, "=") + if len(vals) != 2 { + out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image}) + continue + } + if defaultImage, ok := opts.Images[vals[0]]; ok { + out.Infof("Using {{.image}} instead default image {{.default}}", out.V{"image": vals[1], "name": defaultImage}) + } + opts.Images[vals[0]] = vals[1] } - if defaultImage, ok := opts.Images[vals[0]]; ok { - out.Infof("Using {{.image}} instead default image {{.default}}", out.V{"image": vals[1], "name": defaultImage}) - } - opts.Images[vals[0]] = vals[1] } return opts From de3c901c181751e4b4229d61df867f6a59596dc2 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Mon, 11 Jan 2021 23:15:53 +0800 Subject: [PATCH 04/11] Implement all addons Signed-off-by: Ling Samuel --- cmd/minikube/cmd/config/images.go | 15 +- .../ambassador/ambassador-operator.yaml.tmpl | 2 +- .../deploy/csi-hostpath-attacher.yaml.tmpl | 2 +- .../deploy/csi-hostpath-plugin.yaml.tmpl | 6 +- .../deploy/csi-hostpath-provisioner.yaml.tmpl | 2 +- .../deploy/csi-hostpath-resizer.yaml.tmpl | 2 +- .../deploy/csi-hostpath-snapshotter.yaml.tmpl | 2 +- .../addons/dashboard/dashboard-dp.yaml.tmpl | 4 +- deploy/addons/efk/elasticsearch-rc.yaml.tmpl | 4 +- deploy/addons/efk/fluentd-es-rc.yaml.tmpl | 2 +- deploy/addons/efk/kibana-rc.yaml.tmpl | 2 +- deploy/addons/freshpod/freshpod-rc.yaml.tmpl | 2 +- .../gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl | 6 +- .../gpu/nvidia-driver-installer.yaml.tmpl | 4 +- .../gpu/nvidia-gpu-device-plugin.yaml.tmpl | 2 +- deploy/addons/gvisor/gvisor-pod.yaml.tmpl | 2 +- deploy/addons/helm-tiller/helm-tiller-dp.tmpl | 2 +- .../ingress-dns/ingress-dns-pod.yaml.tmpl | 2 +- deploy/addons/ingress/ingress-dp.yaml.tmpl | 4 +- .../istio-operator.yaml.tmpl | 2 +- deploy/addons/kubevirt/pod.yaml.tmpl | 2 +- .../logviewer/logviewer-dp-and-svc.yaml.tmpl | 2 +- deploy/addons/metallb/metallb.yaml.tmpl | 4 +- .../metrics-server-deployment.yaml.tmpl | 2 +- deploy/addons/olm/olm.yaml.tmpl | 8 +- .../node-etc-hosts-update.tmpl | 4 +- .../registry-aliases/patch-coredns-job.tmpl | 2 +- .../registry-creds-rc.yaml.tmpl | 2 +- .../addons/registry/registry-proxy.yaml.tmpl | 2 +- deploy/addons/registry/registry-rc.yaml.tmpl | 2 +- .../glusterfs-daemonset.yaml.tmpl | 2 +- .../heketi-deployment.yaml.tmpl | 2 +- .../storage-provisioner-glusterfile.yaml.tmpl | 2 +- .../storage-provisioner.yaml.tmpl | 2 +- ...e-snapshot-controller-deployment.yaml.tmpl | 2 +- pkg/minikube/assets/addons.go | 243 ++++++++++++++---- site/content/en/docs/commands/addons.md | 10 +- 37 files changed, 251 insertions(+), 111 deletions(-) diff --git a/cmd/minikube/cmd/config/images.go b/cmd/minikube/cmd/config/images.go index ac63fea70ee3..c18ab35d7c85 100644 --- a/cmd/minikube/cmd/config/images.go +++ b/cmd/minikube/cmd/config/images.go @@ -28,12 +28,13 @@ import ( ) var addonsImagesCmd = &cobra.Command{ - Use: "images ADDON_NAME", - Short: "Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list", - Long: "Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list", + Use: "images ADDON_NAME", + Short: "List image names the addon w/ADDON_NAME used. For a list of available addons use: minikube addons list", + Long: "List image names the addon w/ADDON_NAME used. For a list of available addons use: minikube addons list", + Example: "minikube addons images ingress", Run: func(cmd *cobra.Command, args []string) { if len(args) != 1 { - exit.Message(reason.Usage, "usage: minikube addons configure ADDON_NAME") + exit.Message(reason.Usage, "usage: minikube addons images ADDON_NAME") } addon := args[0] @@ -44,19 +45,19 @@ var addonsImagesCmd = &cobra.Command{ var tData [][]string table := tablewriter.NewWriter(os.Stdout) - table.SetHeader([]string{"Image Name", "Default"}) + table.SetHeader([]string{"Image Name", "Default Image", "Default Registry"}) table.SetAutoFormatHeaders(true) table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true}) table.SetCenterSeparator("|") for imageName, defaultImage := range conf.Images { - tData = append(tData, []string{imageName, defaultImage}) + tData = append(tData, []string{imageName, defaultImage, conf.Registries[imageName]}) } table.AppendBulk(tData) table.Render() } else { - out.Infof("{{.name}} has not been implemented yet", out.V{"name": addon}) + out.Infof("{{.name}} doesn't have images.", out.V{"name": addon}) } } else { out.FailureT("No such addon {{.name}}", out.V{"name": addon}) diff --git a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl index be939dd31bb1..5cb0ae21aa24 100644 --- a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl +++ b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl @@ -180,7 +180,7 @@ spec: containers: - name: ambassador-operator # Replace this with the built image name - image: {{default "quay.io/datawire" .ImageRepository}}/ambassador-operator:v1.2.3 + image: {{default "quay.io/" .ImageRepository}}/{{.Images.AmbassadorOperator}} command: - ambassador-operator imagePullPolicy: Always diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl index d9642f7d1d62..73bb94c5ffb8 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-attacher containers: - name: csi-attacher - image: {{default "quay.io/k8scsi" .ImageRepository}}/csi-attacher:v3.0.0-rc1 + image: {{default "quay.io" .ImageRepository}}/{{.Images.Attacher}} args: - --v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl index fe73c8ff17d3..4bf5d8957ee7 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl @@ -53,7 +53,7 @@ spec: spec: containers: - name: node-driver-registrar - image: {{default "quay.io/k8scsi" .ImageRepository}}/csi-node-driver-registrar:v1.3.0 + image: {{default "quay.io" .ImageRepository}}/{{.Images.NodeDriverRegistrar}} args: - --v=5 - --csi-address=/csi/csi.sock @@ -78,7 +78,7 @@ spec: name: csi-data-dir - name: hostpath - image: {{default "quay.io/k8scsi" .ImageRepository}}/hostpathplugin:v1.4.0-rc2 + image: {{default "quay.io" .ImageRepository}}/{{.Images.HostPathPlugin}} args: - "--drivername=hostpath.csi.k8s.io" - "--v=5" @@ -123,7 +123,7 @@ spec: volumeMounts: - mountPath: /csi name: socket-dir - image: {{default "quay.io/k8scsi" .ImageRepository}}/livenessprobe:v1.1.0 + image: {{default "quay.io" .ImageRepository}}/{{.Images.LivenessProbe}} args: - --csi-address=/csi/csi.sock - --health-port=9898 diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl index 245f6e19ae6e..493fbc9a76ab 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-provisioner containers: - name: csi-provisioner - image: {{default "gcr.io/k8s-staging-sig-storage" .ImageRepository}}/csi-provisioner:v2.0.0-rc2 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.Provisioner}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl index 24a09099cc3a..2499935da802 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-resizer containers: - name: csi-resizer - image: {{default "quay.io/k8scsi" .ImageRepository}}/csi-resizer:v0.6.0-rc1 + image: {{default "quay.io" .ImageRepository}}/{{.Images.Resizer}} args: - -v=5 - -csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl index dcceec8d7d79..d14a6e8d345c 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccount: csi-snapshotter containers: - name: csi-snapshotter - image: {{default "quay.io/k8scsi" .ImageRepository}}/csi-snapshotter:v2.1.0 + image: {{default "quay.io" .ImageRepository}}/{{.Images.Snapshotter}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl index 2a3fb09f726b..a4d38f293458 100644 --- a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl +++ b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl @@ -36,7 +36,7 @@ spec: spec: containers: - name: dashboard-metrics-scraper - image: {{default "kubernetesui" .ImageRepository}}/metrics-scraper:v1.0.4 + image: {{default "docker.io" .ImageRepository}}/{{.Images.MetricsScraper}} ports: - containerPort: 8000 protocol: TCP @@ -91,7 +91,7 @@ spec: containers: - name: kubernetes-dashboard # WARNING: This must match pkg/minikube/bootstrapper/images/images.go - image: {{default "kubernetesui" .ImageRepository}}/dashboard:v2.1.0 + image: {{default "docker.io" .ImageRepository}}/{{.Images.Dashboard}} ports: - containerPort: 9090 protocol: TCP diff --git a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl index 096c4b3390c1..2b54101b450a 100644 --- a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl +++ b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: elasticsearch-logging - image: {{default "k8s.gcr.io" .ImageRepository}}/elasticsearch:v5.6.2 + image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.Elasticsearch}} resources: limits: cpu: 500m @@ -62,7 +62,7 @@ spec: - name: ES_JAVA_OPTS value: "-Xms1024m -Xmx1024m" initContainers: - - image: {{default "registry.hub.docker.com/library" .ImageRepository}}/alpine:3.6 + - image: {{default "docker.io" .ImageRepository}}/{{.Images.Alpine}} command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"] name: elasticsearch-logging-init securityContext: diff --git a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl index 75e38698417c..01b4fc3b532a 100644 --- a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl +++ b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl @@ -31,7 +31,7 @@ spec: spec: containers: - name: fluentd-es - image: {{default "k8s.gcr.io" .ImageRepository}}/fluentd-elasticsearch:v2.0.2 + image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.FluentdElasticsearch}} env: - name: FLUENTD_ARGS value: --no-supervisor -q diff --git a/deploy/addons/efk/kibana-rc.yaml.tmpl b/deploy/addons/efk/kibana-rc.yaml.tmpl index 07305a65ae76..0f87ec5213b2 100644 --- a/deploy/addons/efk/kibana-rc.yaml.tmpl +++ b/deploy/addons/efk/kibana-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: kibana-logging - image: {{default "docker.elastic.co/kibana" .ImageRepository}}/kibana:5.6.2 + image: {{default "docker.elastic.co" .ImageRepository}}/{{.Images.Kibana}} resources: limits: cpu: 500m diff --git a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl index 6d2b9ba5b764..b9ceef20c616 100644 --- a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl +++ b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: freshpod - image: {{default "gcr.io/google-samples" .ImageRepository}}/freshpod:v0.0.1 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.FreshPod}} imagePullPolicy: IfNotPresent volumeMounts: - name: docker diff --git a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl index b6dd98f60e57..fe4b42495230 100644 --- a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl +++ b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl @@ -68,7 +68,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: create - image: {{default "jettech" .ImageRepository}}/kube-webhook-certgen:v1.3.0 + image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - create @@ -94,7 +94,7 @@ spec: spec: containers: - name: gcp-auth - image: {{default "gcr.io/k8s-minikube" .ImageRepository}}/gcp-auth-webhook:v0.0.3 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.GCPAuthWebhook}} imagePullPolicy: IfNotPresent ports: - containerPort: 8443 @@ -127,7 +127,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: patch - image: {{default "jettech" .ImageRepository}}/kube-webhook-certgen:v1.3.0 + image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - patch diff --git a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl index 231f82bc687c..e42e6df44363 100644 --- a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl @@ -50,7 +50,7 @@ spec: hostPath: path: / initContainers: - - image: {{default "k8s.gcr.io" .ImageRepository}}/minikube-nvidia-driver-installer:e2d9b43228decf5d6f7dce3f0a85d390f138fa01 + - image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.NvidiaDriverInstaller}} name: nvidia-driver-installer resources: requests: @@ -72,5 +72,5 @@ spec: - name: root-mount mountPath: /root containers: - - image: "{{default "k8s.gcr.io" .ImageRepository}}/pause:2.0" + - image: "{{default "k8s.gcr.io" .ImageRepository}}/{{.Images.Pause}}" name: pause diff --git a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl index b53a98ebfdec..0ea169b63108 100644 --- a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl @@ -43,7 +43,7 @@ spec: hostPath: path: /var/lib/kubelet/device-plugins containers: - - image: {{default "nvidia" .ImageRepository}}/k8s-device-plugin:1.0.0-beta4 + - image: {{default "docker.io" .ImageRepository}}/{{.Images.NvidiaDevicePlugin}} command: ["/usr/bin/nvidia-device-plugin", "-logtostderr"] name: nvidia-gpu-device-plugin resources: diff --git a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl index 313f020fb449..01fe00fa74d2 100644 --- a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl +++ b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl @@ -25,7 +25,7 @@ spec: hostPID: true containers: - name: gvisor - image: {{default "gcr.io/k8s-minikube" .ImageRepository}}/gvisor-addon:3 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.GvisorAddon}} securityContext: privileged: true volumeMounts: diff --git a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl index cdbc92e96732..d8ddfea19179 100644 --- a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl +++ b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl @@ -46,7 +46,7 @@ spec: value: kube-system - name: TILLER_HISTORY_MAX value: "0" - image: {{default "gcr.io/kubernetes-helm" .ImageRepository}}/tiller:v2.16.12 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.Tiller}} imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 diff --git a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl index 8db1b9dba767..07e2be12b9f0 100644 --- a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl +++ b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl @@ -80,7 +80,7 @@ spec: hostNetwork: true containers: - name: minikube-ingress-dns - image: {{default "cryptexlabs" .ImageRepository}}/minikube-ingress-dns:0.3.0 + image: {{default "docker.io" .ImageRepository}}/{{.Images.IngressDNS}} imagePullPolicy: IfNotPresent ports: - containerPort: 53 diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index 8d184dd13010..d4868dceab5d 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -220,7 +220,7 @@ spec: spec: containers: - name: create - image: {{default "jettech" .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}} + image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}} imagePullPolicy: IfNotPresent args: - create @@ -255,7 +255,7 @@ spec: spec: containers: - name: patch - image: {{default "jettech" .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}} + image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}} imagePullPolicy: args: - patch diff --git a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl index 06b0ba995d43..2ba75b5379cb 100644 --- a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl +++ b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl @@ -218,7 +218,7 @@ spec: serviceAccountName: istio-operator containers: - name: istio-operator - image: docker.io/istio/operator:1.5.0 + image: {{default "docker.io" .ImageRepository}}/{{.Images.IstioOperator}} command: - operator - server diff --git a/deploy/addons/kubevirt/pod.yaml.tmpl b/deploy/addons/kubevirt/pod.yaml.tmpl index 4b8b8b8616d8..0c1bf988aaa2 100644 --- a/deploy/addons/kubevirt/pod.yaml.tmpl +++ b/deploy/addons/kubevirt/pod.yaml.tmpl @@ -50,7 +50,7 @@ spec: - /bin/bash - -c - /kubevirt-scripts/install.sh - image: bitnami/kubectl:1.17 + image: {{default "docker.io" .ImageRepository}}/{{.Images.Kubectl}} imagePullPolicy: IfNotPresent name: kubevirt-provisioner lifecycle: diff --git a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl index 912c6e617fcf..f227d7c6fdbc 100644 --- a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl +++ b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl @@ -42,7 +42,7 @@ spec: containers: - name: logviewer imagePullPolicy: Always - image: {{default "docker.io/ivans3" .ImageRepository}}/minikube-log-viewer:latest + image: {{default "docker.io" .ImageRepository}}/{{.Images.LogViewer}} volumeMounts: - name: logs mountPath: /var/log/containers/ diff --git a/deploy/addons/metallb/metallb.yaml.tmpl b/deploy/addons/metallb/metallb.yaml.tmpl index 8cf8ddab961c..78128b83dab7 100644 --- a/deploy/addons/metallb/metallb.yaml.tmpl +++ b/deploy/addons/metallb/metallb.yaml.tmpl @@ -212,7 +212,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: {{default "metallb" .ImageRepository}}/speaker:v0.8.2 + image: {{default "docker.io" .ImageRepository}}/{{.Images.Speaker}} imagePullPolicy: IfNotPresent name: speaker ports: @@ -268,7 +268,7 @@ spec: - args: - --port=7472 - --config=config - image: {{default "metallb" .ImageRepository}}/controller:v0.8.2 + image: {{default "docker.io" .ImageRepository}}/{{.Images.Controller}} imagePullPolicy: IfNotPresent name: controller ports: diff --git a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl index 7fcc530a1643..6066ef475d84 100644 --- a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl +++ b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl @@ -19,7 +19,7 @@ spec: spec: containers: - name: metrics-server - image: {{default "k8s.gcr.io" .ImageRepository}}/metrics-server-{{.Arch}}:v0.2.1 + image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.MetricsServer}} imagePullPolicy: IfNotPresent command: - /metrics-server diff --git a/deploy/addons/olm/olm.yaml.tmpl b/deploy/addons/olm/olm.yaml.tmpl index e034a9604d8d..4e28cc5f6110 100644 --- a/deploy/addons/olm/olm.yaml.tmpl +++ b/deploy/addons/olm/olm.yaml.tmpl @@ -82,7 +82,7 @@ spec: - $(OPERATOR_NAMESPACE) - -writeStatusName - "" - image: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373 + image: {{default "quay.io" .ImageRepository}}/{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -143,7 +143,7 @@ spec: - '-namespace' - olm - -configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest - image: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373 + image: {{default "quay.io" .ImageRepository}}/{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -307,7 +307,7 @@ spec: - "5443" - --global-namespace - olm - image: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373 + image: {{default "quay.io" .ImageRepository}}/{{.Images.OLM}} imagePullPolicy: Always ports: - containerPort: 5443 @@ -346,6 +346,6 @@ metadata: namespace: olm spec: sourceType: grpc - image: quay.io/operator-framework/upstream-community-operators:latest + image: {{default "quay.io" .ImageRepository}}/{{.Images.UpstreamCommunityOperators}} displayName: Community Operators publisher: OperatorHub.io \ No newline at end of file diff --git a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl index 1294201a358d..f4bb5ea002cb 100644 --- a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl +++ b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl @@ -17,7 +17,7 @@ spec: spec: initContainers: - name: update - image: {{default "registry.hub.docker.com/library" .ImageRepository}}/alpine:3.11 + image: {{default "docker.io" .ImageRepository}}/{{.Images.Alpine}} volumeMounts: - name: etchosts mountPath: /host-etc/hosts @@ -43,7 +43,7 @@ spec: echo "Done." containers: - name: pause-for-update - image: {{default "gcr.io/google_containers" .ImageRepository}}/pause-amd64:3.1 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.Pause}} terminationGracePeriodSeconds: 30 volumes: - name: etchosts diff --git a/deploy/addons/registry-aliases/patch-coredns-job.tmpl b/deploy/addons/registry-aliases/patch-coredns-job.tmpl index bab8756536af..8a7a74b000dc 100644 --- a/deploy/addons/registry-aliases/patch-coredns-job.tmpl +++ b/deploy/addons/registry-aliases/patch-coredns-job.tmpl @@ -15,7 +15,7 @@ spec: path: /var/lib/minikube/binaries containers: - name: core-dns-patcher - image: {{default "quay.io/rhdevelopers" .ImageRepository}}/core-dns-patcher + image: {{default "quay.io" .ImageRepository}}/{{.Images.CoreDNSPatcher}} imagePullPolicy: IfNotPresent # using the kubectl from the minikube instance volumeMounts: diff --git a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl index 7f6a7c46b53d..891f5b283524 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: {{default "upmcenterprises" .ImageRepository}}/registry-creds:1.10 + - image: {{default "docker.io" .ImageRepository}}/{{.Images.RegistryCreds}} name: registry-creds imagePullPolicy: Always env: diff --git a/deploy/addons/registry/registry-proxy.yaml.tmpl b/deploy/addons/registry/registry-proxy.yaml.tmpl index 7b8fc3bf16fb..80d5ebe25b12 100644 --- a/deploy/addons/registry/registry-proxy.yaml.tmpl +++ b/deploy/addons/registry/registry-proxy.yaml.tmpl @@ -19,7 +19,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default "gcr.io/google_containers" .ImageRepository}}/kube-registry-proxy:0.4 + - image: {{default "gcr.io" .ImageRepository}}/{{.Images.KubeRegistryProxy}} imagePullPolicy: IfNotPresent name: registry-proxy ports: diff --git a/deploy/addons/registry/registry-rc.yaml.tmpl b/deploy/addons/registry/registry-rc.yaml.tmpl index fd1333a6ca91..4a7165ed7d2a 100644 --- a/deploy/addons/registry/registry-rc.yaml.tmpl +++ b/deploy/addons/registry/registry-rc.yaml.tmpl @@ -18,7 +18,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default "registry.hub.docker.com/library" .ImageRepository}}/registry:2.7.1 + - image: {{default "docker.io" .ImageRepository}}/{{.Images.Registry}} imagePullPolicy: IfNotPresent name: registry ports: diff --git a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl index 1072213168c1..da629732e20f 100644 --- a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl @@ -31,7 +31,7 @@ spec: # kubernetes.io/hostname: minikube hostNetwork: true containers: - - image: {{default "quay.io/nixpanic" .ImageRepository}}/glusterfs-server:pr_fake-disk + - image: {{default "quay.io" .ImageRepository}}/{{.Images.GlusterfsServer}} imagePullPolicy: IfNotPresent name: glusterfs env: diff --git a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl index c99217087e4b..fdc7fbd270fb 100644 --- a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl @@ -116,7 +116,7 @@ spec: spec: serviceAccountName: heketi-service-account containers: - - image: {{default "heketi" .ImageRepository}}/heketi:latest + - image: {{default "docker.io" .ImageRepository}}/{{.Images.Heketi}} imagePullPolicy: IfNotPresent name: heketi env: diff --git a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl index 6777d0e37540..ebefe5557d3c 100644 --- a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl @@ -106,7 +106,7 @@ spec: serviceAccountName: glusterfile-provisioner containers: - name: glusterfile-provisioner - image: {{default "gluster" .ImageRepository}}/glusterfile-provisioner:latest + image: {{default "docker.io" .ImageRepository}}/{{.Images.GlusterfileProvisioner}} imagePullPolicy: Always env: - name: PROVISIONER_NAME diff --git a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl index 61d7adcdc062..9910e536f8d1 100644 --- a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl +++ b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl @@ -100,7 +100,7 @@ spec: hostNetwork: true containers: - name: storage-provisioner - image: {{default "gcr.io/k8s-minikube" .ImageRepository}}/storage-provisioner:{{.StorageProvisionerVersion}} + image: {{default "gcr.io" .ImageRepository}}/{{.Images.StorageProvisioner}} command: ["/storage-provisioner"] imagePullPolicy: IfNotPresent volumeMounts: diff --git a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl index 82928f1a4da8..1dcfd77e6f1e 100644 --- a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl +++ b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl @@ -23,7 +23,7 @@ spec: containers: - name: volume-snapshot-controller # TODO(xyang): Replace with an official image when it is released - image: {{default "gcr.io/k8s-staging-csi" .ImageRepository}}/snapshot-controller:v2.0.0-rc2 + image: {{default "gcr.io" .ImageRepository}}/{{.Images.SnapshotController}} args: - "--v=5" imagePullPolicy: Always diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index e0c99bfefe1c..bcc9cf884814 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -17,6 +17,7 @@ limitations under the License. package assets import ( + "fmt" "runtime" "strings" @@ -34,14 +35,19 @@ type Addon struct { enabled bool addonName string Images map[string]string + + // Registries currently only shows the default registry of images + Registries map[string]string } // NewAddon creates a new Addon -func NewAddon(assets []*BinAsset, enabled bool, addonName string) *Addon { +func NewAddon(assets []*BinAsset, enabled bool, addonName string, images map[string]string, registries map[string]string) *Addon { a := &Addon{ - Assets: assets, - enabled: enabled, - addonName: addonName, + Assets: assets, + enabled: enabled, + addonName: addonName, + Images: images, + Registries: registries, } return a } @@ -62,11 +68,6 @@ func (a *Addon) IsEnabled(cc *config.ClusterConfig) bool { return a.enabled } -func (a *Addon) setImages(images map[string]string) *Addon { - a.Images = images - return a -} - // Addons is the list of addons // TODO: Make dynamically loadable: move this data to a .yaml file within each addon directory var Addons = map[string]*Addon{ @@ -82,28 +83,38 @@ var Addons = map[string]*Addon{ MustBinAsset("deploy/addons/dashboard/dashboard-sa.yaml", vmpath.GuestAddonsDir, "dashboard-sa.yaml", "0640"), MustBinAsset("deploy/addons/dashboard/dashboard-secret.yaml", vmpath.GuestAddonsDir, "dashboard-secret.yaml", "0640"), MustBinAsset("deploy/addons/dashboard/dashboard-svc.yaml", vmpath.GuestAddonsDir, "dashboard-svc.yaml", "0640"), - }, false, "dashboard"), + }, false, "dashboard", map[string]string{ + "Dashboard": "kubernetesui/dashboard:v2.1.0", + "MetricsScraper": "kubernetesui/metrics-scraper:v1.0.4", + }, map[string]string{ + "Dashboard": "docker.io", + "MetricsScraper": "docker.io", + }), "default-storageclass": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/storageclass/storageclass.yaml.tmpl", vmpath.GuestAddonsDir, "storageclass.yaml", "0640"), - }, true, "default-storageclass"), + }, true, "default-storageclass", nil, nil), "pod-security-policy": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/pod-security-policy/pod-security-policy.yaml.tmpl", vmpath.GuestAddonsDir, "pod-security-policy.yaml", "0640"), - }, false, "pod-security-policy"), + }, false, "pod-security-policy", nil, nil), "storage-provisioner": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl", vmpath.GuestAddonsDir, "storage-provisioner.yaml", "0640"), - }, true, "storage-provisioner"), + }, true, "storage-provisioner", map[string]string{ + "StorageProvisioner": fmt.Sprintf("k8s-minikube/storage-provisioner:%s", version.GetStorageProvisionerVersion()), + }, map[string]string{ + "StorageProvisioner": "gcr.io", + }), "storage-provisioner-gluster": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/storage-provisioner-gluster/storage-gluster-ns.yaml.tmpl", @@ -125,7 +136,15 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "storage-privisioner-glusterfile.yaml", "0640"), - }, false, "storage-provisioner-gluster"), + }, false, "storage-provisioner-gluster", map[string]string{ + "Heketi": "heketi/heketi:latest", + "GlusterfileProvisioner": "gluster/glusterfile-provisioner:latest", + "GlusterfsServer": "nixpanic/glusterfs-server:pr_fake-disk", + }, map[string]string{ + "Heketi": "docker.io", + "GlusterfileProvisioner": "docker.io", + "GlusterfsServer": "quay.io", + }), "efk": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/efk/elasticsearch-rc.yaml.tmpl", @@ -157,7 +176,17 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "kibana-svc.yaml", "0640"), - }, false, "efk"), + }, false, "efk", map[string]string{ + "Elasticsearch": "elasticsearch:v5.6.2", + "FluentdElasticsearch": "fluentd-elasticsearch:v2.0.2", + "Alpine": "alpine:3.6", + "Kibana": "kibana/kibana:5.6.2", + }, map[string]string{ + "Elasticsearch": "k8s.gcr.io", + "FluentdElasticsearch": "k8s.gcr.io", + "Alpine": "docker.io", + "Kibana": "docker.elastic.co", + }), "ingress": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/ingress/ingress-configmap.yaml.tmpl", @@ -174,10 +203,14 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "ingress-dp.yaml", "0640"), - }, false, "ingress").setImages(map[string]string{ - "IngressController": "ingress-nginx/controller:v0.40.2", - "KubeWebhookCertgenCreate": "kube-webhook-certgen:v1.2.2", - "KubeWebhookCertgenPatch": "kube-webhook-certgen:v1.3.0", + }, false, "ingress", map[string]string{ + "IngressController": "k8s-artifacts-prod/ingress-nginx/controller:v0.40.2", + "KubeWebhookCertgenCreate": "jettech/kube-webhook-certgen:v1.2.2", + "KubeWebhookCertgenPatch": "jettech/kube-webhook-certgen:v1.3.0", + }, map[string]string{ + "IngressController": "us.gcr.io", + "KubeWebhookCertgenCreate": "docker.io", + "KubeWebhookCertgenPatch": "docker.io", }), "istio-provisioner": NewAddon([]*BinAsset{ MustBinAsset( @@ -185,21 +218,29 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "istio-operator.yaml", "0640"), - }, false, "istio-provisioner"), + }, false, "istio-provisioner", map[string]string{ + "IstioOperator": "istio/operator:1.5.0", + }, map[string]string{ + "IstioOperator": "docker.io", + }), "istio": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/istio/istio-default-profile.yaml.tmpl", vmpath.GuestAddonsDir, "istio-default-profile.yaml", "0640"), - }, false, "istio"), + }, false, "istio", nil, nil), "kubevirt": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/kubevirt/pod.yaml.tmpl", vmpath.GuestAddonsDir, "pod.yaml", "0640"), - }, false, "kubevirt"), + }, false, "kubevirt", map[string]string{ + "Kubectl": "bitnami/kubectl:1.17", + }, map[string]string{ + "Kubectl": "docker.io", + }), "metrics-server": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/metrics-server/metrics-apiservice.yaml.tmpl", @@ -216,7 +257,11 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "metrics-server-service.yaml", "0640"), - }, false, "metrics-server"), + }, false, "metrics-server", map[string]string{ + "MetricsServer": fmt.Sprintf("metrics-server-%s:v0.2.1", runtime.GOARCH), + }, map[string]string{ + "MetricsServer": "k8s.gcr.io", + }), "olm": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/olm/crds.yaml.tmpl", @@ -228,7 +273,13 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "olm.yaml", "0640"), - }, false, "olm"), + }, false, "olm", map[string]string{ + "OLM": "operator-framework/olm:0.14.1", + "UpstreamCommunityOperators": "operator-framework/upstream-community-operators:latest", + }, map[string]string{ + "OLM": "quay.io", + "UpstreamCommunityOperators": "quay.io", + }), "registry": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/registry/registry-rc.yaml.tmpl", @@ -245,14 +296,24 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "registry-proxy.yaml", "0640"), - }, false, "registry"), + }, false, "registry", map[string]string{ + "Registry": "registry:2.7.1", + "KubeRegistryProxy": "google_containers/kube-registry-proxy:0.4", + }, map[string]string{ + "Registry": "docker.io", + "KubeRegistryProxy": "gcr.io", + }), "registry-creds": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl", vmpath.GuestAddonsDir, "registry-creds-rc.yaml", "0640"), - }, false, "registry-creds"), + }, false, "registry-creds", map[string]string{ + "RegistryCreds": "upmcenterprises/registry-creds:1.10", + }, map[string]string{ + "RegistryCreds": "docker.io", + }), "registry-aliases": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/registry-aliases/registry-aliases-sa.tmpl", @@ -279,28 +340,50 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "patch-coredns-job.yaml", "0640"), - }, false, "registry-aliases"), + }, false, "registry-aliases", map[string]string{ + "CoreDNSPatcher": "rhdevelopers/core-dns-patcher", + "Alpine": "alpine:3.11", + "Pause": "google_containers/pause-amd64:3.1", + }, map[string]string{ + "CoreDNSPatcher": "quay.io", + "Alpine": "docker.io", + "Pause": "gcr.io", + }), "freshpod": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/freshpod/freshpod-rc.yaml.tmpl", vmpath.GuestAddonsDir, "freshpod-rc.yaml", "0640"), - }, false, "freshpod"), + }, false, "freshpod", map[string]string{ + "FreshPod": "google-samples/freshpod:v0.0.1", + }, map[string]string{ + "FreshPod": "gcr.io", + }), "nvidia-driver-installer": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl", vmpath.GuestAddonsDir, "nvidia-driver-installer.yaml", "0640"), - }, false, "nvidia-driver-installer"), + }, false, "nvidia-driver-installer", map[string]string{ + "NvidiaDriverInstaller": "minikube-nvidia-driver-installer:e2d9b43228decf5d6f7dce3f0a85d390f138fa01", + "Pause": "pause:2.0", + }, map[string]string{ + "NvidiaDriverInstaller": "k8s.gcr.io", + "Pause": "k8s.gcr.io", + }), "nvidia-gpu-device-plugin": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl", vmpath.GuestAddonsDir, "nvidia-gpu-device-plugin.yaml", "0640"), - }, false, "nvidia-gpu-device-plugin"), + }, false, "nvidia-gpu-device-plugin", map[string]string{ + "NvidiaDevicePlugin": "nvidia/k8s-device-plugin:1.0.0-beta4", + }, map[string]string{ + "NvidiaDevicePlugin": "docker.io", + }), "logviewer": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl", @@ -312,7 +395,11 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "logviewer-rbac.yaml", "0640"), - }, false, "logviewer"), + }, false, "logviewer", map[string]string{ + "LogViewer": "ivans3/minikube-log-viewer:latest", + }, map[string]string{ + "LogViewer": "docker.io", + }), "gvisor": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/gvisor/gvisor-pod.yaml.tmpl", @@ -329,7 +416,11 @@ var Addons = map[string]*Addon{ vmpath.GuestGvisorDir, constants.GvisorConfigTomlTargetName, "0640"), - }, false, "gvisor"), + }, false, "gvisor", map[string]string{ + "GvisorAddon": "k8s-minikube/gvisor-addon:3", + }, map[string]string{ + "GvisorAddon": "gcr.io", + }), "helm-tiller": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/helm-tiller/helm-tiller-dp.tmpl", @@ -346,14 +437,22 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "helm-tiller-svc.yaml", "0640"), - }, false, "helm-tiller"), + }, false, "helm-tiller", map[string]string{ + "Tiller": "kubernetes-helm/tiller:v2.16.12", + }, map[string]string{ + "Tiller": "gcr.io", + }), "ingress-dns": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl", vmpath.GuestAddonsDir, "ingress-dns-pod.yaml", "0640"), - }, false, "ingress-dns"), + }, false, "ingress-dns", map[string]string{ + "IngressDNS": "cryptexlabs/minikube-ingress-dns:0.3.0", + }, map[string]string{ + "IngressDNS": "docker.io", + }), "metallb": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/metallb/metallb.yaml.tmpl", @@ -365,7 +464,13 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "metallb-config.yaml", "0640"), - }, false, "metallb"), + }, false, "metallb", map[string]string{ + "Speaker": "metallb/speaker:v0.8.2", + "Controller": "metallb/controller:v0.8.2", + }, map[string]string{ + "Speaker": "docker.io", + "Controller": "docker.io", + }), "ambassador": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/ambassador/ambassador-operator-crds.yaml.tmpl", @@ -382,7 +487,11 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "ambassadorinstallation.yaml", "0640"), - }, false, "ambassador"), + }, false, "ambassador", map[string]string{ + "AmbassadorOperator": "datawire/ambassador-operator:v1.2.3", + }, map[string]string{ + "AmbassadorOperator": "quay.io", + }), "gcp-auth": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/gcp-auth/gcp-auth-ns.yaml.tmpl", @@ -399,7 +508,13 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "gcp-auth-webhook.yaml", "0640"), - }, false, "gcp-auth"), + }, false, "gcp-auth", map[string]string{ + "KubeWebhookCertgen": "jettech/kube-webhook-certgen:v1.3.0", + "GCPAuthWebhook": "k8s-minikube/gcp-auth-webhook:v0.0.3", + }, map[string]string{ + "KubeWebhookCertgen": "docker.io", + "GCPAuthWebhook": "gcr.io", + }), "volumesnapshots": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/volumesnapshots/snapshot.storage.k8s.io_volumesnapshotclasses.yaml.tmpl", @@ -426,7 +541,11 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "volume-snapshot-controller-deployment.yaml", "0640"), - }, false, "volumesnapshots"), + }, false, "volumesnapshots", map[string]string{ + "SnapshotController": "k8s-staging-csi/snapshot-controller:v2.0.0-rc2", + }, map[string]string{ + "SnapshotController": "gcr.io", + }), "csi-hostpath-driver": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/csi-hostpath-driver/rbac/rbac-external-attacher.yaml.tmpl", @@ -483,7 +602,23 @@ var Addons = map[string]*Addon{ vmpath.GuestAddonsDir, "csi-hostpath-storageclass.yaml", "0640"), - }, false, "csi-hostpath-driver"), + }, false, "csi-hostpath-driver", map[string]string{ + "Attacher": "k8scsi/csi-attacher:v3.0.0-rc1", + "NodeDriverRegistrar": "k8scsi/csi-node-driver-registrar:v1.3.0", + "HostPathPlugin": "k8scsi/hostpathplugin:v1.4.0-rc2", + "LivenessProbe": "k8scsi/livenessprobe:v1.1.0", + "Resizer": "k8scsi/csi-resizer:v0.6.0-rc1", + "Snapshotter": "k8scsi/csi-snapshotter:v2.1.0", + "Provisioner": "k8s-staging-sig-storage/csi-provisioner:v2.0.0-rc2", + }, map[string]string{ + "Attacher": "quay.io", + "NodeDriverRegistrar": "quay.io", + "HostPathPlugin": "quay.io", + "LivenessProbe": "quay.io", + "Resizer": "quay.io", + "Snapshotter": "quay.io", + "Provisioner": "gcr.io", + }), } // GenerateTemplateData generates template data for template assets @@ -497,23 +632,21 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} ea = "-" + runtime.GOARCH } opts := struct { - Arch string - ExoticArch string - ImageRepository string - LoadBalancerStartIP string - LoadBalancerEndIP string - CustomIngressCert string - StorageProvisionerVersion string - Images map[string]string + Arch string + ExoticArch string + ImageRepository string + LoadBalancerStartIP string + LoadBalancerEndIP string + CustomIngressCert string + Images map[string]string }{ - Arch: a, - ExoticArch: ea, - ImageRepository: cfg.ImageRepository, - LoadBalancerStartIP: cfg.LoadBalancerStartIP, - LoadBalancerEndIP: cfg.LoadBalancerEndIP, - CustomIngressCert: cfg.CustomIngressCert, - StorageProvisionerVersion: version.GetStorageProvisionerVersion(), - Images: addon.Images, + Arch: a, + ExoticArch: ea, + ImageRepository: cfg.ImageRepository, + LoadBalancerStartIP: cfg.LoadBalancerStartIP, + LoadBalancerEndIP: cfg.LoadBalancerEndIP, + CustomIngressCert: cfg.CustomIngressCert, + Images: addon.Images, } if opts.Images == nil { diff --git a/site/content/en/docs/commands/addons.md b/site/content/en/docs/commands/addons.md index 58e4b318ac30..36333a369d62 100644 --- a/site/content/en/docs/commands/addons.md +++ b/site/content/en/docs/commands/addons.md @@ -184,16 +184,22 @@ minikube addons help [command] [flags] ## minikube addons images -Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list +List image names the addon w/ADDON_NAME used. For a list of available addons use: minikube addons list ### Synopsis -Alpha feature. List image names the addon w/ADDON_NAME used (example: minikube addons images ingress). For a list of available addons use: minikube addons list +List image names the addon w/ADDON_NAME used. For a list of available addons use: minikube addons list ```shell minikube addons images ADDON_NAME [flags] ``` +### Examples + +``` +minikube addons images ingress +``` + ### Options inherited from parent commands ``` From 76833fd2fabfd95c49421520a705999a762116ff Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Mon, 11 Jan 2021 23:33:42 +0800 Subject: [PATCH 05/11] Make registry configurable Signed-off-by: Ling Samuel --- deploy/addons/ambassador/ambassador-operator.yaml.tmpl | 2 +- .../deploy/csi-hostpath-attacher.yaml.tmpl | 2 +- .../deploy/csi-hostpath-plugin.yaml.tmpl | 6 +++--- .../deploy/csi-hostpath-provisioner.yaml.tmpl | 2 +- .../deploy/csi-hostpath-resizer.yaml.tmpl | 2 +- .../deploy/csi-hostpath-snapshotter.yaml.tmpl | 2 +- deploy/addons/dashboard/dashboard-dp.yaml.tmpl | 4 ++-- deploy/addons/efk/elasticsearch-rc.yaml.tmpl | 4 ++-- deploy/addons/efk/fluentd-es-rc.yaml.tmpl | 2 +- deploy/addons/efk/kibana-rc.yaml.tmpl | 2 +- deploy/addons/freshpod/freshpod-rc.yaml.tmpl | 2 +- deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl | 6 +++--- deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl | 2 +- deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl | 2 +- deploy/addons/gvisor/gvisor-pod.yaml.tmpl | 2 +- deploy/addons/helm-tiller/helm-tiller-dp.tmpl | 2 +- deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl | 2 +- deploy/addons/ingress/ingress-dp.yaml.tmpl | 6 +++--- deploy/addons/istio-provisioner/istio-operator.yaml.tmpl | 2 +- deploy/addons/kubevirt/pod.yaml.tmpl | 2 +- deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl | 2 +- deploy/addons/metallb/metallb.yaml.tmpl | 4 ++-- .../metrics-server/metrics-server-deployment.yaml.tmpl | 2 +- deploy/addons/olm/olm.yaml.tmpl | 8 ++++---- deploy/addons/registry-aliases/node-etc-hosts-update.tmpl | 4 ++-- deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl | 2 +- deploy/addons/registry/registry-proxy.yaml.tmpl | 2 +- deploy/addons/registry/registry-rc.yaml.tmpl | 2 +- .../glusterfs-daemonset.yaml.tmpl | 2 +- .../heketi-deployment.yaml.tmpl | 2 +- .../storage-provisioner-glusterfile.yaml.tmpl | 2 +- .../storage-provisioner/storage-provisioner.yaml.tmpl | 2 +- .../volume-snapshot-controller-deployment.yaml.tmpl | 2 +- pkg/minikube/assets/addons.go | 2 ++ 34 files changed, 48 insertions(+), 46 deletions(-) diff --git a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl index 5cb0ae21aa24..57e67d24e165 100644 --- a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl +++ b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl @@ -180,7 +180,7 @@ spec: containers: - name: ambassador-operator # Replace this with the built image name - image: {{default "quay.io/" .ImageRepository}}/{{.Images.AmbassadorOperator}} + image: {{default .Registries.AmbassadorOperator .ImageRepository}}/{{.Images.AmbassadorOperator}} command: - ambassador-operator imagePullPolicy: Always diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl index 73bb94c5ffb8..371ac65845e9 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-attacher containers: - name: csi-attacher - image: {{default "quay.io" .ImageRepository}}/{{.Images.Attacher}} + image: {{default .Registries.Attacher .ImageRepository}}/{{.Images.Attacher}} args: - --v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl index 4bf5d8957ee7..ff9ea1b9b0e4 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl @@ -53,7 +53,7 @@ spec: spec: containers: - name: node-driver-registrar - image: {{default "quay.io" .ImageRepository}}/{{.Images.NodeDriverRegistrar}} + image: {{default .Registries.NodeDriverRegistrar .ImageRepository}}/{{.Images.NodeDriverRegistrar}} args: - --v=5 - --csi-address=/csi/csi.sock @@ -78,7 +78,7 @@ spec: name: csi-data-dir - name: hostpath - image: {{default "quay.io" .ImageRepository}}/{{.Images.HostPathPlugin}} + image: {{default .Registries.HostPathPlugin .ImageRepository}}/{{.Images.HostPathPlugin}} args: - "--drivername=hostpath.csi.k8s.io" - "--v=5" @@ -123,7 +123,7 @@ spec: volumeMounts: - mountPath: /csi name: socket-dir - image: {{default "quay.io" .ImageRepository}}/{{.Images.LivenessProbe}} + image: {{default .Registries.LivenessProbe .ImageRepository}}/{{.Images.LivenessProbe}} args: - --csi-address=/csi/csi.sock - --health-port=9898 diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl index 493fbc9a76ab..0afc654b9acf 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-provisioner containers: - name: csi-provisioner - image: {{default "gcr.io" .ImageRepository}}/{{.Images.Provisioner}} + image: {{default .Registries.Provisioner .ImageRepository}}/{{.Images.Provisioner}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl index 2499935da802..6b6d18709d41 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-resizer containers: - name: csi-resizer - image: {{default "quay.io" .ImageRepository}}/{{.Images.Resizer}} + image: {{default .Registries.Resizer .ImageRepository}}/{{.Images.Resizer}} args: - -v=5 - -csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl index d14a6e8d345c..98d736d4186c 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccount: csi-snapshotter containers: - name: csi-snapshotter - image: {{default "quay.io" .ImageRepository}}/{{.Images.Snapshotter}} + image: {{default .Registries.Snapshotter .ImageRepository}}/{{.Images.Snapshotter}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl index a4d38f293458..73fe1a914948 100644 --- a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl +++ b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl @@ -36,7 +36,7 @@ spec: spec: containers: - name: dashboard-metrics-scraper - image: {{default "docker.io" .ImageRepository}}/{{.Images.MetricsScraper}} + image: {{default .Registries.MetricsScraper .ImageRepository}}/{{.Images.MetricsScraper}} ports: - containerPort: 8000 protocol: TCP @@ -91,7 +91,7 @@ spec: containers: - name: kubernetes-dashboard # WARNING: This must match pkg/minikube/bootstrapper/images/images.go - image: {{default "docker.io" .ImageRepository}}/{{.Images.Dashboard}} + image: {{default .Registries.Dashboard .ImageRepository}}/{{.Images.Dashboard}} ports: - containerPort: 9090 protocol: TCP diff --git a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl index 2b54101b450a..d407ef9ed59f 100644 --- a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl +++ b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: elasticsearch-logging - image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.Elasticsearch}} + image: {{default .Registries.Elasticsearch .ImageRepository}}/{{.Images.Elasticsearch}} resources: limits: cpu: 500m @@ -62,7 +62,7 @@ spec: - name: ES_JAVA_OPTS value: "-Xms1024m -Xmx1024m" initContainers: - - image: {{default "docker.io" .ImageRepository}}/{{.Images.Alpine}} + - image: {{default .Registries.Alpine .ImageRepository}}/{{.Images.Alpine}} command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"] name: elasticsearch-logging-init securityContext: diff --git a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl index 01b4fc3b532a..5d196ff68671 100644 --- a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl +++ b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl @@ -31,7 +31,7 @@ spec: spec: containers: - name: fluentd-es - image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.FluentdElasticsearch}} + image: {{default .Registries.FluentdElasticsearch .ImageRepository}}/{{.Images.FluentdElasticsearch}} env: - name: FLUENTD_ARGS value: --no-supervisor -q diff --git a/deploy/addons/efk/kibana-rc.yaml.tmpl b/deploy/addons/efk/kibana-rc.yaml.tmpl index 0f87ec5213b2..356bf30dacc8 100644 --- a/deploy/addons/efk/kibana-rc.yaml.tmpl +++ b/deploy/addons/efk/kibana-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: kibana-logging - image: {{default "docker.elastic.co" .ImageRepository}}/{{.Images.Kibana}} + image: {{default .Registries.Kibana .ImageRepository}}/{{.Images.Kibana}} resources: limits: cpu: 500m diff --git a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl index b9ceef20c616..502db2418c2f 100644 --- a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl +++ b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: freshpod - image: {{default "gcr.io" .ImageRepository}}/{{.Images.FreshPod}} + image: {{default .Registries.FreshPod .ImageRepository}}/{{.Images.FreshPod}} imagePullPolicy: IfNotPresent volumeMounts: - name: docker diff --git a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl index fe4b42495230..5cf3f61ce24f 100644 --- a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl +++ b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl @@ -68,7 +68,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: create - image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgen}} + image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}/{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - create @@ -94,7 +94,7 @@ spec: spec: containers: - name: gcp-auth - image: {{default "gcr.io" .ImageRepository}}/{{.Images.GCPAuthWebhook}} + image: {{default .Registries.GCPAuthWebhook .ImageRepository}}/{{.Images.GCPAuthWebhook}} imagePullPolicy: IfNotPresent ports: - containerPort: 8443 @@ -127,7 +127,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: patch - image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgen}} + image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}/{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - patch diff --git a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl index e42e6df44363..338abd715574 100644 --- a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl @@ -50,7 +50,7 @@ spec: hostPath: path: / initContainers: - - image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.NvidiaDriverInstaller}} + - image: {{default .Registries.NvidiaDriverInstaller .ImageRepository}}/{{.Images.NvidiaDriverInstaller}} name: nvidia-driver-installer resources: requests: diff --git a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl index 0ea169b63108..62314b107ecc 100644 --- a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl @@ -43,7 +43,7 @@ spec: hostPath: path: /var/lib/kubelet/device-plugins containers: - - image: {{default "docker.io" .ImageRepository}}/{{.Images.NvidiaDevicePlugin}} + - image: {{default .Registries.NvidiaDevicePlugin .ImageRepository}}/{{.Images.NvidiaDevicePlugin}} command: ["/usr/bin/nvidia-device-plugin", "-logtostderr"] name: nvidia-gpu-device-plugin resources: diff --git a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl index 01fe00fa74d2..a60ab3777666 100644 --- a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl +++ b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl @@ -25,7 +25,7 @@ spec: hostPID: true containers: - name: gvisor - image: {{default "gcr.io" .ImageRepository}}/{{.Images.GvisorAddon}} + image: {{default .Registries.GvisorAddon .ImageRepository}}/{{.Images.GvisorAddon}} securityContext: privileged: true volumeMounts: diff --git a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl index d8ddfea19179..da06ae1c8b86 100644 --- a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl +++ b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl @@ -46,7 +46,7 @@ spec: value: kube-system - name: TILLER_HISTORY_MAX value: "0" - image: {{default "gcr.io" .ImageRepository}}/{{.Images.Tiller}} + image: {{default .Registries.Tiller .ImageRepository}}/{{.Images.Tiller}} imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 diff --git a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl index 07e2be12b9f0..4d07f1b7ce2f 100644 --- a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl +++ b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl @@ -80,7 +80,7 @@ spec: hostNetwork: true containers: - name: minikube-ingress-dns - image: {{default "docker.io" .ImageRepository}}/{{.Images.IngressDNS}} + image: {{default .Registries.IngressDNS .ImageRepository}}/{{.Images.IngressDNS}} imagePullPolicy: IfNotPresent ports: - containerPort: 53 diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index d4868dceab5d..146025290e14 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -49,7 +49,7 @@ spec: serviceAccountName: ingress-nginx containers: - name: controller - image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{.Images.IngressController}} + image: {{default .Registries.IngressController .ImageRepository}}/{{.Images.IngressController}} imagePullPolicy: IfNotPresent lifecycle: preStop: @@ -220,7 +220,7 @@ spec: spec: containers: - name: create - image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}} + image: {{default .Registries.KubeWebhookCertgenCreate .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}} imagePullPolicy: IfNotPresent args: - create @@ -255,7 +255,7 @@ spec: spec: containers: - name: patch - image: {{default "docker.io" .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}} + image: {{default .Registries.KubeWebhookCertgenPatch .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}} imagePullPolicy: args: - patch diff --git a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl index 2ba75b5379cb..8211d3933178 100644 --- a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl +++ b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl @@ -218,7 +218,7 @@ spec: serviceAccountName: istio-operator containers: - name: istio-operator - image: {{default "docker.io" .ImageRepository}}/{{.Images.IstioOperator}} + image: {{default .Registries.IstioOperator .ImageRepository}}/{{.Images.IstioOperator}} command: - operator - server diff --git a/deploy/addons/kubevirt/pod.yaml.tmpl b/deploy/addons/kubevirt/pod.yaml.tmpl index 0c1bf988aaa2..d43502b5f932 100644 --- a/deploy/addons/kubevirt/pod.yaml.tmpl +++ b/deploy/addons/kubevirt/pod.yaml.tmpl @@ -50,7 +50,7 @@ spec: - /bin/bash - -c - /kubevirt-scripts/install.sh - image: {{default "docker.io" .ImageRepository}}/{{.Images.Kubectl}} + image: {{default .Registries.Kubectl .ImageRepository}}/{{.Images.Kubectl}} imagePullPolicy: IfNotPresent name: kubevirt-provisioner lifecycle: diff --git a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl index f227d7c6fdbc..ac88a6e2618b 100644 --- a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl +++ b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl @@ -42,7 +42,7 @@ spec: containers: - name: logviewer imagePullPolicy: Always - image: {{default "docker.io" .ImageRepository}}/{{.Images.LogViewer}} + image: {{default .Registries.LogViewer .ImageRepository}}/{{.Images.LogViewer}} volumeMounts: - name: logs mountPath: /var/log/containers/ diff --git a/deploy/addons/metallb/metallb.yaml.tmpl b/deploy/addons/metallb/metallb.yaml.tmpl index 78128b83dab7..2dc0875468fe 100644 --- a/deploy/addons/metallb/metallb.yaml.tmpl +++ b/deploy/addons/metallb/metallb.yaml.tmpl @@ -212,7 +212,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: {{default "docker.io" .ImageRepository}}/{{.Images.Speaker}} + image: {{default .Registries.Speaker .ImageRepository}}/{{.Images.Speaker}} imagePullPolicy: IfNotPresent name: speaker ports: @@ -268,7 +268,7 @@ spec: - args: - --port=7472 - --config=config - image: {{default "docker.io" .ImageRepository}}/{{.Images.Controller}} + image: {{default .Registries.Controller .ImageRepository}}/{{.Images.Controller}} imagePullPolicy: IfNotPresent name: controller ports: diff --git a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl index 6066ef475d84..e553c08cd770 100644 --- a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl +++ b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl @@ -19,7 +19,7 @@ spec: spec: containers: - name: metrics-server - image: {{default "k8s.gcr.io" .ImageRepository}}/{{.Images.MetricsServer}} + image: {{default .Registries.MetricsServer .ImageRepository}}/{{.Images.MetricsServer}} imagePullPolicy: IfNotPresent command: - /metrics-server diff --git a/deploy/addons/olm/olm.yaml.tmpl b/deploy/addons/olm/olm.yaml.tmpl index 4e28cc5f6110..5d1c8673de50 100644 --- a/deploy/addons/olm/olm.yaml.tmpl +++ b/deploy/addons/olm/olm.yaml.tmpl @@ -82,7 +82,7 @@ spec: - $(OPERATOR_NAMESPACE) - -writeStatusName - "" - image: {{default "quay.io" .ImageRepository}}/{{.Images.OLM}} + image: {{default .Registries.OLM .ImageRepository}}/{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -143,7 +143,7 @@ spec: - '-namespace' - olm - -configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest - image: {{default "quay.io" .ImageRepository}}/{{.Images.OLM}} + image: {{default .Registries.OLM .ImageRepository}}/{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -307,7 +307,7 @@ spec: - "5443" - --global-namespace - olm - image: {{default "quay.io" .ImageRepository}}/{{.Images.OLM}} + image: {{default .Registries.OLM .ImageRepository}}/{{.Images.OLM}} imagePullPolicy: Always ports: - containerPort: 5443 @@ -346,6 +346,6 @@ metadata: namespace: olm spec: sourceType: grpc - image: {{default "quay.io" .ImageRepository}}/{{.Images.UpstreamCommunityOperators}} + image: {{default .Registries.UpstreamCommunityOperators .ImageRepository}}/{{.Images.UpstreamCommunityOperators}} displayName: Community Operators publisher: OperatorHub.io \ No newline at end of file diff --git a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl index f4bb5ea002cb..e03d7d77f17c 100644 --- a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl +++ b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl @@ -17,7 +17,7 @@ spec: spec: initContainers: - name: update - image: {{default "docker.io" .ImageRepository}}/{{.Images.Alpine}} + image: {{default .Registries.Alpine .ImageRepository}}/{{.Images.Alpine}} volumeMounts: - name: etchosts mountPath: /host-etc/hosts @@ -43,7 +43,7 @@ spec: echo "Done." containers: - name: pause-for-update - image: {{default "gcr.io" .ImageRepository}}/{{.Images.Pause}} + image: {{default .Registries.Pause .ImageRepository}}/{{.Images.Pause}} terminationGracePeriodSeconds: 30 volumes: - name: etchosts diff --git a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl index 891f5b283524..8ea8848a127f 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: {{default "docker.io" .ImageRepository}}/{{.Images.RegistryCreds}} + - image: {{default .Registries.RegistryCreds .ImageRepository}}/{{.Images.RegistryCreds}} name: registry-creds imagePullPolicy: Always env: diff --git a/deploy/addons/registry/registry-proxy.yaml.tmpl b/deploy/addons/registry/registry-proxy.yaml.tmpl index 80d5ebe25b12..8842058adf23 100644 --- a/deploy/addons/registry/registry-proxy.yaml.tmpl +++ b/deploy/addons/registry/registry-proxy.yaml.tmpl @@ -19,7 +19,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default "gcr.io" .ImageRepository}}/{{.Images.KubeRegistryProxy}} + - image: {{default .Registries.KubeRegistryProxy .ImageRepository}}/{{.Images.KubeRegistryProxy}} imagePullPolicy: IfNotPresent name: registry-proxy ports: diff --git a/deploy/addons/registry/registry-rc.yaml.tmpl b/deploy/addons/registry/registry-rc.yaml.tmpl index 4a7165ed7d2a..7db20a49e551 100644 --- a/deploy/addons/registry/registry-rc.yaml.tmpl +++ b/deploy/addons/registry/registry-rc.yaml.tmpl @@ -18,7 +18,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default "docker.io" .ImageRepository}}/{{.Images.Registry}} + - image: {{default .Registries.Registry .ImageRepository}}/{{.Images.Registry}} imagePullPolicy: IfNotPresent name: registry ports: diff --git a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl index da629732e20f..d94287e17c99 100644 --- a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl @@ -31,7 +31,7 @@ spec: # kubernetes.io/hostname: minikube hostNetwork: true containers: - - image: {{default "quay.io" .ImageRepository}}/{{.Images.GlusterfsServer}} + - image: {{default .Registries.GlusterfsServer .ImageRepository}}/{{.Images.GlusterfsServer}} imagePullPolicy: IfNotPresent name: glusterfs env: diff --git a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl index fdc7fbd270fb..da4e3341d2e6 100644 --- a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl @@ -116,7 +116,7 @@ spec: spec: serviceAccountName: heketi-service-account containers: - - image: {{default "docker.io" .ImageRepository}}/{{.Images.Heketi}} + - image: {{default .Registries.Heketi .ImageRepository}}/{{.Images.Heketi}} imagePullPolicy: IfNotPresent name: heketi env: diff --git a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl index ebefe5557d3c..af0ddc53ef6b 100644 --- a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl @@ -106,7 +106,7 @@ spec: serviceAccountName: glusterfile-provisioner containers: - name: glusterfile-provisioner - image: {{default "docker.io" .ImageRepository}}/{{.Images.GlusterfileProvisioner}} + image: {{default .Registries.GlusterfileProvisioner .ImageRepository}}/{{.Images.GlusterfileProvisioner}} imagePullPolicy: Always env: - name: PROVISIONER_NAME diff --git a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl index 9910e536f8d1..1ec47136f70a 100644 --- a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl +++ b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl @@ -100,7 +100,7 @@ spec: hostNetwork: true containers: - name: storage-provisioner - image: {{default "gcr.io" .ImageRepository}}/{{.Images.StorageProvisioner}} + image: {{default .Registries.StorageProvisioner .ImageRepository}}/{{.Images.StorageProvisioner}} command: ["/storage-provisioner"] imagePullPolicy: IfNotPresent volumeMounts: diff --git a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl index 1dcfd77e6f1e..b0d44980bbb3 100644 --- a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl +++ b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl @@ -23,7 +23,7 @@ spec: containers: - name: volume-snapshot-controller # TODO(xyang): Replace with an official image when it is released - image: {{default "gcr.io" .ImageRepository}}/{{.Images.SnapshotController}} + image: {{default .Registries.SnapshotController .ImageRepository}}/{{.Images.SnapshotController}} args: - "--v=5" imagePullPolicy: Always diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index bcc9cf884814..de7151725085 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -639,6 +639,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} LoadBalancerEndIP string CustomIngressCert string Images map[string]string + Registries map[string]string }{ Arch: a, ExoticArch: ea, @@ -647,6 +648,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} LoadBalancerEndIP: cfg.LoadBalancerEndIP, CustomIngressCert: cfg.CustomIngressCert, Images: addon.Images, + Registries: addon.Registries, } if opts.Images == nil { From 52f0e49a1e0a905bb14184e468e33f698e38cb23 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Tue, 12 Jan 2021 00:00:33 +0800 Subject: [PATCH 06/11] Fix docker.io/ prefix Signed-off-by: Ling Samuel --- cmd/minikube/cmd/config/enable.go | 14 +-- .../ambassador/ambassador-operator.yaml.tmpl | 2 +- .../deploy/csi-hostpath-attacher.yaml.tmpl | 2 +- .../deploy/csi-hostpath-plugin.yaml.tmpl | 6 +- .../deploy/csi-hostpath-provisioner.yaml.tmpl | 2 +- .../deploy/csi-hostpath-resizer.yaml.tmpl | 2 +- .../deploy/csi-hostpath-snapshotter.yaml.tmpl | 2 +- .../addons/dashboard/dashboard-dp.yaml.tmpl | 4 +- deploy/addons/efk/elasticsearch-rc.yaml.tmpl | 4 +- deploy/addons/efk/fluentd-es-rc.yaml.tmpl | 2 +- deploy/addons/efk/kibana-rc.yaml.tmpl | 2 +- deploy/addons/freshpod/freshpod-rc.yaml.tmpl | 2 +- .../gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl | 6 +- .../gpu/nvidia-driver-installer.yaml.tmpl | 2 +- .../gpu/nvidia-gpu-device-plugin.yaml.tmpl | 2 +- deploy/addons/gvisor/gvisor-pod.yaml.tmpl | 2 +- deploy/addons/helm-tiller/helm-tiller-dp.tmpl | 2 +- .../ingress-dns/ingress-dns-pod.yaml.tmpl | 2 +- deploy/addons/ingress/ingress-dp.yaml.tmpl | 6 +- .../istio-operator.yaml.tmpl | 2 +- deploy/addons/kubevirt/pod.yaml.tmpl | 2 +- .../logviewer/logviewer-dp-and-svc.yaml.tmpl | 2 +- deploy/addons/metallb/metallb.yaml.tmpl | 4 +- .../metrics-server-deployment.yaml.tmpl | 2 +- deploy/addons/olm/olm.yaml.tmpl | 8 +- .../node-etc-hosts-update.tmpl | 4 +- .../registry-creds-rc.yaml.tmpl | 2 +- .../addons/registry/registry-proxy.yaml.tmpl | 2 +- deploy/addons/registry/registry-rc.yaml.tmpl | 2 +- .../glusterfs-daemonset.yaml.tmpl | 2 +- .../heketi-deployment.yaml.tmpl | 2 +- .../storage-provisioner-glusterfile.yaml.tmpl | 2 +- .../storage-provisioner.yaml.tmpl | 2 +- ...e-snapshot-controller-deployment.yaml.tmpl | 2 +- pkg/minikube/assets/addons.go | 90 ++++++++++--------- pkg/minikube/config/config.go | 2 + site/content/en/docs/commands/addons.md | 13 ++- 37 files changed, 117 insertions(+), 94 deletions(-) diff --git a/cmd/minikube/cmd/config/enable.go b/cmd/minikube/cmd/config/enable.go index fd593c82cd01..f79a07ab4c49 100644 --- a/cmd/minikube/cmd/config/enable.go +++ b/cmd/minikube/cmd/config/enable.go @@ -31,9 +31,10 @@ import ( ) var addonsEnableCmd = &cobra.Command{ - Use: "enable ADDON_NAME", - Short: "Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list ", - Long: "Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list ", + Use: "enable ADDON_NAME", + Short: "Enables the addon w/ADDON_NAME within minikube. For a list of available addons use: minikube addons list ", + Long: "Enables the addon w/ADDON_NAME within minikube. For a list of available addons use: minikube addons list ", + Example: "minikube addons enable dashboard", Run: func(cmd *cobra.Command, args []string) { if len(args) != 1 { exit.Message(reason.Usage, "usage: minikube addons enable ADDON_NAME") @@ -45,6 +46,7 @@ var addonsEnableCmd = &cobra.Command{ addon = "metrics-server" } viper.Set(config.AddonImages, images) + viper.Set(config.AddonRegistries, registries) err := addons.SetAndSave(ClusterFlagValue(), addon, "true") if err != nil { exit.Error(reason.InternalEnable, "enable failed", err) @@ -67,10 +69,12 @@ var addonsEnableCmd = &cobra.Command{ } var ( - images string + images string + registries string ) func init() { - addonsEnableCmd.Flags().StringVar(&images, "images", "", "Alpha feature. Image names used by this addon. Divided by comma.") + addonsEnableCmd.Flags().StringVar(&images, "images", "", "Images used by this addon. Divided by comma.") + addonsEnableCmd.Flags().StringVar(®istries, "registries", "", "Registries used by this addon. Divided by comma.") AddonsCmd.AddCommand(addonsEnableCmd) } diff --git a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl index 57e67d24e165..a2391acb0644 100644 --- a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl +++ b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl @@ -180,7 +180,7 @@ spec: containers: - name: ambassador-operator # Replace this with the built image name - image: {{default .Registries.AmbassadorOperator .ImageRepository}}/{{.Images.AmbassadorOperator}} + image: {{default .Registries.AmbassadorOperator .ImageRepository}}{{.Images.AmbassadorOperator}} command: - ambassador-operator imagePullPolicy: Always diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl index 371ac65845e9..e37357afbc30 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-attacher containers: - name: csi-attacher - image: {{default .Registries.Attacher .ImageRepository}}/{{.Images.Attacher}} + image: {{default .Registries.Attacher .ImageRepository}}{{.Images.Attacher}} args: - --v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl index ff9ea1b9b0e4..552f6619fc65 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl @@ -53,7 +53,7 @@ spec: spec: containers: - name: node-driver-registrar - image: {{default .Registries.NodeDriverRegistrar .ImageRepository}}/{{.Images.NodeDriverRegistrar}} + image: {{default .Registries.NodeDriverRegistrar .ImageRepository}}{{.Images.NodeDriverRegistrar}} args: - --v=5 - --csi-address=/csi/csi.sock @@ -78,7 +78,7 @@ spec: name: csi-data-dir - name: hostpath - image: {{default .Registries.HostPathPlugin .ImageRepository}}/{{.Images.HostPathPlugin}} + image: {{default .Registries.HostPathPlugin .ImageRepository}}{{.Images.HostPathPlugin}} args: - "--drivername=hostpath.csi.k8s.io" - "--v=5" @@ -123,7 +123,7 @@ spec: volumeMounts: - mountPath: /csi name: socket-dir - image: {{default .Registries.LivenessProbe .ImageRepository}}/{{.Images.LivenessProbe}} + image: {{default .Registries.LivenessProbe .ImageRepository}}{{.Images.LivenessProbe}} args: - --csi-address=/csi/csi.sock - --health-port=9898 diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl index 0afc654b9acf..b88dd7c0aade 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-provisioner containers: - name: csi-provisioner - image: {{default .Registries.Provisioner .ImageRepository}}/{{.Images.Provisioner}} + image: {{default .Registries.Provisioner .ImageRepository}}{{.Images.Provisioner}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl index 6b6d18709d41..36cad376e22f 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-resizer containers: - name: csi-resizer - image: {{default .Registries.Resizer .ImageRepository}}/{{.Images.Resizer}} + image: {{default .Registries.Resizer .ImageRepository}}{{.Images.Resizer}} args: - -v=5 - -csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl index 98d736d4186c..0190e28e0e9b 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccount: csi-snapshotter containers: - name: csi-snapshotter - image: {{default .Registries.Snapshotter .ImageRepository}}/{{.Images.Snapshotter}} + image: {{default .Registries.Snapshotter .ImageRepository}}{{.Images.Snapshotter}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl index 73fe1a914948..bdec475f55ca 100644 --- a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl +++ b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl @@ -36,7 +36,7 @@ spec: spec: containers: - name: dashboard-metrics-scraper - image: {{default .Registries.MetricsScraper .ImageRepository}}/{{.Images.MetricsScraper}} + image: {{default .Registries.MetricsScraper .ImageRepository}}{{.Images.MetricsScraper}} ports: - containerPort: 8000 protocol: TCP @@ -91,7 +91,7 @@ spec: containers: - name: kubernetes-dashboard # WARNING: This must match pkg/minikube/bootstrapper/images/images.go - image: {{default .Registries.Dashboard .ImageRepository}}/{{.Images.Dashboard}} + image: {{default .Registries.Dashboard .ImageRepository}}{{.Images.Dashboard}} ports: - containerPort: 9090 protocol: TCP diff --git a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl index d407ef9ed59f..59f5231f7d6d 100644 --- a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl +++ b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: elasticsearch-logging - image: {{default .Registries.Elasticsearch .ImageRepository}}/{{.Images.Elasticsearch}} + image: {{default .Registries.Elasticsearch .ImageRepository}}{{.Images.Elasticsearch}} resources: limits: cpu: 500m @@ -62,7 +62,7 @@ spec: - name: ES_JAVA_OPTS value: "-Xms1024m -Xmx1024m" initContainers: - - image: {{default .Registries.Alpine .ImageRepository}}/{{.Images.Alpine}} + - image: {{default .Registries.Alpine .ImageRepository}}{{.Images.Alpine}} command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"] name: elasticsearch-logging-init securityContext: diff --git a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl index 5d196ff68671..a1669c253645 100644 --- a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl +++ b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl @@ -31,7 +31,7 @@ spec: spec: containers: - name: fluentd-es - image: {{default .Registries.FluentdElasticsearch .ImageRepository}}/{{.Images.FluentdElasticsearch}} + image: {{default .Registries.FluentdElasticsearch .ImageRepository}}{{.Images.FluentdElasticsearch}} env: - name: FLUENTD_ARGS value: --no-supervisor -q diff --git a/deploy/addons/efk/kibana-rc.yaml.tmpl b/deploy/addons/efk/kibana-rc.yaml.tmpl index 356bf30dacc8..e13faa98b16f 100644 --- a/deploy/addons/efk/kibana-rc.yaml.tmpl +++ b/deploy/addons/efk/kibana-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: kibana-logging - image: {{default .Registries.Kibana .ImageRepository}}/{{.Images.Kibana}} + image: {{default .Registries.Kibana .ImageRepository}}{{.Images.Kibana}} resources: limits: cpu: 500m diff --git a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl index 502db2418c2f..c5112c8c8c10 100644 --- a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl +++ b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: freshpod - image: {{default .Registries.FreshPod .ImageRepository}}/{{.Images.FreshPod}} + image: {{default .Registries.FreshPod .ImageRepository}}{{.Images.FreshPod}} imagePullPolicy: IfNotPresent volumeMounts: - name: docker diff --git a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl index 5cf3f61ce24f..a2f24e6c8d93 100644 --- a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl +++ b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl @@ -68,7 +68,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: create - image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}/{{.Images.KubeWebhookCertgen}} + image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - create @@ -94,7 +94,7 @@ spec: spec: containers: - name: gcp-auth - image: {{default .Registries.GCPAuthWebhook .ImageRepository}}/{{.Images.GCPAuthWebhook}} + image: {{default .Registries.GCPAuthWebhook .ImageRepository}}{{.Images.GCPAuthWebhook}} imagePullPolicy: IfNotPresent ports: - containerPort: 8443 @@ -127,7 +127,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: patch - image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}/{{.Images.KubeWebhookCertgen}} + image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - patch diff --git a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl index 338abd715574..27d4e99f5bcf 100644 --- a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl @@ -50,7 +50,7 @@ spec: hostPath: path: / initContainers: - - image: {{default .Registries.NvidiaDriverInstaller .ImageRepository}}/{{.Images.NvidiaDriverInstaller}} + - image: {{default .Registries.NvidiaDriverInstaller .ImageRepository}}{{.Images.NvidiaDriverInstaller}} name: nvidia-driver-installer resources: requests: diff --git a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl index 62314b107ecc..a540fb77d732 100644 --- a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl @@ -43,7 +43,7 @@ spec: hostPath: path: /var/lib/kubelet/device-plugins containers: - - image: {{default .Registries.NvidiaDevicePlugin .ImageRepository}}/{{.Images.NvidiaDevicePlugin}} + - image: {{default .Registries.NvidiaDevicePlugin .ImageRepository}}{{.Images.NvidiaDevicePlugin}} command: ["/usr/bin/nvidia-device-plugin", "-logtostderr"] name: nvidia-gpu-device-plugin resources: diff --git a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl index a60ab3777666..7e9ad3666472 100644 --- a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl +++ b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl @@ -25,7 +25,7 @@ spec: hostPID: true containers: - name: gvisor - image: {{default .Registries.GvisorAddon .ImageRepository}}/{{.Images.GvisorAddon}} + image: {{default .Registries.GvisorAddon .ImageRepository}}{{.Images.GvisorAddon}} securityContext: privileged: true volumeMounts: diff --git a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl index da06ae1c8b86..023d2feed4da 100644 --- a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl +++ b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl @@ -46,7 +46,7 @@ spec: value: kube-system - name: TILLER_HISTORY_MAX value: "0" - image: {{default .Registries.Tiller .ImageRepository}}/{{.Images.Tiller}} + image: {{default .Registries.Tiller .ImageRepository}}{{.Images.Tiller}} imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 diff --git a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl index 4d07f1b7ce2f..abf54da11cc1 100644 --- a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl +++ b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl @@ -80,7 +80,7 @@ spec: hostNetwork: true containers: - name: minikube-ingress-dns - image: {{default .Registries.IngressDNS .ImageRepository}}/{{.Images.IngressDNS}} + image: {{default .Registries.IngressDNS .ImageRepository}}{{.Images.IngressDNS}} imagePullPolicy: IfNotPresent ports: - containerPort: 53 diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index 146025290e14..4b29c64c83be 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -49,7 +49,7 @@ spec: serviceAccountName: ingress-nginx containers: - name: controller - image: {{default .Registries.IngressController .ImageRepository}}/{{.Images.IngressController}} + image: {{default .Registries.IngressController .ImageRepository}}{{.Images.IngressController}} imagePullPolicy: IfNotPresent lifecycle: preStop: @@ -220,7 +220,7 @@ spec: spec: containers: - name: create - image: {{default .Registries.KubeWebhookCertgenCreate .ImageRepository}}/{{.Images.KubeWebhookCertgenCreate}} + image: {{default .Registries.KubeWebhookCertgenCreate .ImageRepository}}{{.Images.KubeWebhookCertgenCreate}} imagePullPolicy: IfNotPresent args: - create @@ -255,7 +255,7 @@ spec: spec: containers: - name: patch - image: {{default .Registries.KubeWebhookCertgenPatch .ImageRepository}}/{{.Images.KubeWebhookCertgenPatch}} + image: {{default .Registries.KubeWebhookCertgenPatch .ImageRepository}}{{.Images.KubeWebhookCertgenPatch}} imagePullPolicy: args: - patch diff --git a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl index 8211d3933178..d907629316ab 100644 --- a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl +++ b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl @@ -218,7 +218,7 @@ spec: serviceAccountName: istio-operator containers: - name: istio-operator - image: {{default .Registries.IstioOperator .ImageRepository}}/{{.Images.IstioOperator}} + image: {{default .Registries.IstioOperator .ImageRepository}}{{.Images.IstioOperator}} command: - operator - server diff --git a/deploy/addons/kubevirt/pod.yaml.tmpl b/deploy/addons/kubevirt/pod.yaml.tmpl index d43502b5f932..50279f5badf2 100644 --- a/deploy/addons/kubevirt/pod.yaml.tmpl +++ b/deploy/addons/kubevirt/pod.yaml.tmpl @@ -50,7 +50,7 @@ spec: - /bin/bash - -c - /kubevirt-scripts/install.sh - image: {{default .Registries.Kubectl .ImageRepository}}/{{.Images.Kubectl}} + image: {{default .Registries.Kubectl .ImageRepository}}{{.Images.Kubectl}} imagePullPolicy: IfNotPresent name: kubevirt-provisioner lifecycle: diff --git a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl index ac88a6e2618b..c4ff7100e424 100644 --- a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl +++ b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl @@ -42,7 +42,7 @@ spec: containers: - name: logviewer imagePullPolicy: Always - image: {{default .Registries.LogViewer .ImageRepository}}/{{.Images.LogViewer}} + image: {{default .Registries.LogViewer .ImageRepository}}{{.Images.LogViewer}} volumeMounts: - name: logs mountPath: /var/log/containers/ diff --git a/deploy/addons/metallb/metallb.yaml.tmpl b/deploy/addons/metallb/metallb.yaml.tmpl index 2dc0875468fe..911e170038ff 100644 --- a/deploy/addons/metallb/metallb.yaml.tmpl +++ b/deploy/addons/metallb/metallb.yaml.tmpl @@ -212,7 +212,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: {{default .Registries.Speaker .ImageRepository}}/{{.Images.Speaker}} + image: {{default .Registries.Speaker .ImageRepository}}{{.Images.Speaker}} imagePullPolicy: IfNotPresent name: speaker ports: @@ -268,7 +268,7 @@ spec: - args: - --port=7472 - --config=config - image: {{default .Registries.Controller .ImageRepository}}/{{.Images.Controller}} + image: {{default .Registries.Controller .ImageRepository}}{{.Images.Controller}} imagePullPolicy: IfNotPresent name: controller ports: diff --git a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl index e553c08cd770..630042fd2ce3 100644 --- a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl +++ b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl @@ -19,7 +19,7 @@ spec: spec: containers: - name: metrics-server - image: {{default .Registries.MetricsServer .ImageRepository}}/{{.Images.MetricsServer}} + image: {{default .Registries.MetricsServer .ImageRepository}}{{.Images.MetricsServer}} imagePullPolicy: IfNotPresent command: - /metrics-server diff --git a/deploy/addons/olm/olm.yaml.tmpl b/deploy/addons/olm/olm.yaml.tmpl index 5d1c8673de50..69344cc7141b 100644 --- a/deploy/addons/olm/olm.yaml.tmpl +++ b/deploy/addons/olm/olm.yaml.tmpl @@ -82,7 +82,7 @@ spec: - $(OPERATOR_NAMESPACE) - -writeStatusName - "" - image: {{default .Registries.OLM .ImageRepository}}/{{.Images.OLM}} + image: {{default .Registries.OLM .ImageRepository}}{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -143,7 +143,7 @@ spec: - '-namespace' - olm - -configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest - image: {{default .Registries.OLM .ImageRepository}}/{{.Images.OLM}} + image: {{default .Registries.OLM .ImageRepository}}{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -307,7 +307,7 @@ spec: - "5443" - --global-namespace - olm - image: {{default .Registries.OLM .ImageRepository}}/{{.Images.OLM}} + image: {{default .Registries.OLM .ImageRepository}}{{.Images.OLM}} imagePullPolicy: Always ports: - containerPort: 5443 @@ -346,6 +346,6 @@ metadata: namespace: olm spec: sourceType: grpc - image: {{default .Registries.UpstreamCommunityOperators .ImageRepository}}/{{.Images.UpstreamCommunityOperators}} + image: {{default .Registries.UpstreamCommunityOperators .ImageRepository}}{{.Images.UpstreamCommunityOperators}} displayName: Community Operators publisher: OperatorHub.io \ No newline at end of file diff --git a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl index e03d7d77f17c..5ceee2ef695a 100644 --- a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl +++ b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl @@ -17,7 +17,7 @@ spec: spec: initContainers: - name: update - image: {{default .Registries.Alpine .ImageRepository}}/{{.Images.Alpine}} + image: {{default .Registries.Alpine .ImageRepository}}{{.Images.Alpine}} volumeMounts: - name: etchosts mountPath: /host-etc/hosts @@ -43,7 +43,7 @@ spec: echo "Done." containers: - name: pause-for-update - image: {{default .Registries.Pause .ImageRepository}}/{{.Images.Pause}} + image: {{default .Registries.Pause .ImageRepository}}{{.Images.Pause}} terminationGracePeriodSeconds: 30 volumes: - name: etchosts diff --git a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl index 8ea8848a127f..729fc0c82ba9 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: {{default .Registries.RegistryCreds .ImageRepository}}/{{.Images.RegistryCreds}} + - image: {{default .Registries.RegistryCreds .ImageRepository}}{{.Images.RegistryCreds}} name: registry-creds imagePullPolicy: Always env: diff --git a/deploy/addons/registry/registry-proxy.yaml.tmpl b/deploy/addons/registry/registry-proxy.yaml.tmpl index 8842058adf23..4c083e4b48dc 100644 --- a/deploy/addons/registry/registry-proxy.yaml.tmpl +++ b/deploy/addons/registry/registry-proxy.yaml.tmpl @@ -19,7 +19,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default .Registries.KubeRegistryProxy .ImageRepository}}/{{.Images.KubeRegistryProxy}} + - image: {{default .Registries.KubeRegistryProxy .ImageRepository}}{{.Images.KubeRegistryProxy}} imagePullPolicy: IfNotPresent name: registry-proxy ports: diff --git a/deploy/addons/registry/registry-rc.yaml.tmpl b/deploy/addons/registry/registry-rc.yaml.tmpl index 7db20a49e551..73cbb67147cc 100644 --- a/deploy/addons/registry/registry-rc.yaml.tmpl +++ b/deploy/addons/registry/registry-rc.yaml.tmpl @@ -18,7 +18,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default .Registries.Registry .ImageRepository}}/{{.Images.Registry}} + - image: {{default .Registries.Registry .ImageRepository}}{{.Images.Registry}} imagePullPolicy: IfNotPresent name: registry ports: diff --git a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl index d94287e17c99..f4c4a2a5c89e 100644 --- a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl @@ -31,7 +31,7 @@ spec: # kubernetes.io/hostname: minikube hostNetwork: true containers: - - image: {{default .Registries.GlusterfsServer .ImageRepository}}/{{.Images.GlusterfsServer}} + - image: {{default .Registries.GlusterfsServer .ImageRepository}}{{.Images.GlusterfsServer}} imagePullPolicy: IfNotPresent name: glusterfs env: diff --git a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl index da4e3341d2e6..e604e810c2bd 100644 --- a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl @@ -116,7 +116,7 @@ spec: spec: serviceAccountName: heketi-service-account containers: - - image: {{default .Registries.Heketi .ImageRepository}}/{{.Images.Heketi}} + - image: {{default .Registries.Heketi .ImageRepository}}{{.Images.Heketi}} imagePullPolicy: IfNotPresent name: heketi env: diff --git a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl index af0ddc53ef6b..49b54b387ddc 100644 --- a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl @@ -106,7 +106,7 @@ spec: serviceAccountName: glusterfile-provisioner containers: - name: glusterfile-provisioner - image: {{default .Registries.GlusterfileProvisioner .ImageRepository}}/{{.Images.GlusterfileProvisioner}} + image: {{default .Registries.GlusterfileProvisioner .ImageRepository}}{{.Images.GlusterfileProvisioner}} imagePullPolicy: Always env: - name: PROVISIONER_NAME diff --git a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl index 1ec47136f70a..fff4bf89c842 100644 --- a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl +++ b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl @@ -100,7 +100,7 @@ spec: hostNetwork: true containers: - name: storage-provisioner - image: {{default .Registries.StorageProvisioner .ImageRepository}}/{{.Images.StorageProvisioner}} + image: {{default .Registries.StorageProvisioner .ImageRepository}}{{.Images.StorageProvisioner}} command: ["/storage-provisioner"] imagePullPolicy: IfNotPresent volumeMounts: diff --git a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl index b0d44980bbb3..57bebeaba002 100644 --- a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl +++ b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl @@ -23,7 +23,7 @@ spec: containers: - name: volume-snapshot-controller # TODO(xyang): Replace with an official image when it is released - image: {{default .Registries.SnapshotController .ImageRepository}}/{{.Images.SnapshotController}} + image: {{default .Registries.SnapshotController .ImageRepository}}{{.Images.SnapshotController}} args: - "--v=5" imagePullPolicy: Always diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index de7151725085..699f0f18eae5 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -25,6 +25,7 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/out" + "k8s.io/minikube/pkg/minikube/style" "k8s.io/minikube/pkg/minikube/vmpath" "k8s.io/minikube/pkg/version" ) @@ -86,10 +87,7 @@ var Addons = map[string]*Addon{ }, false, "dashboard", map[string]string{ "Dashboard": "kubernetesui/dashboard:v2.1.0", "MetricsScraper": "kubernetesui/metrics-scraper:v1.0.4", - }, map[string]string{ - "Dashboard": "docker.io", - "MetricsScraper": "docker.io", - }), + }, nil), "default-storageclass": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/storageclass/storageclass.yaml.tmpl", @@ -141,9 +139,7 @@ var Addons = map[string]*Addon{ "GlusterfileProvisioner": "gluster/glusterfile-provisioner:latest", "GlusterfsServer": "nixpanic/glusterfs-server:pr_fake-disk", }, map[string]string{ - "Heketi": "docker.io", - "GlusterfileProvisioner": "docker.io", - "GlusterfsServer": "quay.io", + "GlusterfsServer": "quay.io", }), "efk": NewAddon([]*BinAsset{ MustBinAsset( @@ -184,7 +180,6 @@ var Addons = map[string]*Addon{ }, map[string]string{ "Elasticsearch": "k8s.gcr.io", "FluentdElasticsearch": "k8s.gcr.io", - "Alpine": "docker.io", "Kibana": "docker.elastic.co", }), "ingress": NewAddon([]*BinAsset{ @@ -208,9 +203,7 @@ var Addons = map[string]*Addon{ "KubeWebhookCertgenCreate": "jettech/kube-webhook-certgen:v1.2.2", "KubeWebhookCertgenPatch": "jettech/kube-webhook-certgen:v1.3.0", }, map[string]string{ - "IngressController": "us.gcr.io", - "KubeWebhookCertgenCreate": "docker.io", - "KubeWebhookCertgenPatch": "docker.io", + "IngressController": "us.gcr.io", }), "istio-provisioner": NewAddon([]*BinAsset{ MustBinAsset( @@ -220,9 +213,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "istio-provisioner", map[string]string{ "IstioOperator": "istio/operator:1.5.0", - }, map[string]string{ - "IstioOperator": "docker.io", - }), + }, nil), "istio": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/istio/istio-default-profile.yaml.tmpl", @@ -238,9 +229,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "kubevirt", map[string]string{ "Kubectl": "bitnami/kubectl:1.17", - }, map[string]string{ - "Kubectl": "docker.io", - }), + }, nil), "metrics-server": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/metrics-server/metrics-apiservice.yaml.tmpl", @@ -300,7 +289,6 @@ var Addons = map[string]*Addon{ "Registry": "registry:2.7.1", "KubeRegistryProxy": "google_containers/kube-registry-proxy:0.4", }, map[string]string{ - "Registry": "docker.io", "KubeRegistryProxy": "gcr.io", }), "registry-creds": NewAddon([]*BinAsset{ @@ -311,9 +299,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "registry-creds", map[string]string{ "RegistryCreds": "upmcenterprises/registry-creds:1.10", - }, map[string]string{ - "RegistryCreds": "docker.io", - }), + }, nil), "registry-aliases": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/registry-aliases/registry-aliases-sa.tmpl", @@ -346,7 +332,6 @@ var Addons = map[string]*Addon{ "Pause": "google_containers/pause-amd64:3.1", }, map[string]string{ "CoreDNSPatcher": "quay.io", - "Alpine": "docker.io", "Pause": "gcr.io", }), "freshpod": NewAddon([]*BinAsset{ @@ -381,9 +366,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "nvidia-gpu-device-plugin", map[string]string{ "NvidiaDevicePlugin": "nvidia/k8s-device-plugin:1.0.0-beta4", - }, map[string]string{ - "NvidiaDevicePlugin": "docker.io", - }), + }, nil), "logviewer": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl", @@ -397,9 +380,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "logviewer", map[string]string{ "LogViewer": "ivans3/minikube-log-viewer:latest", - }, map[string]string{ - "LogViewer": "docker.io", - }), + }, nil), "gvisor": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/gvisor/gvisor-pod.yaml.tmpl", @@ -450,9 +431,7 @@ var Addons = map[string]*Addon{ "0640"), }, false, "ingress-dns", map[string]string{ "IngressDNS": "cryptexlabs/minikube-ingress-dns:0.3.0", - }, map[string]string{ - "IngressDNS": "docker.io", - }), + }, nil), "metallb": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/metallb/metallb.yaml.tmpl", @@ -467,10 +446,7 @@ var Addons = map[string]*Addon{ }, false, "metallb", map[string]string{ "Speaker": "metallb/speaker:v0.8.2", "Controller": "metallb/controller:v0.8.2", - }, map[string]string{ - "Speaker": "docker.io", - "Controller": "docker.io", - }), + }, nil), "ambassador": NewAddon([]*BinAsset{ MustBinAsset( "deploy/addons/ambassador/ambassador-operator-crds.yaml.tmpl", @@ -512,8 +488,7 @@ var Addons = map[string]*Addon{ "KubeWebhookCertgen": "jettech/kube-webhook-certgen:v1.3.0", "GCPAuthWebhook": "k8s-minikube/gcp-auth-webhook:v0.0.3", }, map[string]string{ - "KubeWebhookCertgen": "docker.io", - "GCPAuthWebhook": "gcr.io", + "GCPAuthWebhook": "gcr.io", }), "volumesnapshots": NewAddon([]*BinAsset{ MustBinAsset( @@ -663,12 +638,47 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image}) continue } - if defaultImage, ok := opts.Images[vals[0]]; ok { - out.Infof("Using {{.image}} instead default image {{.default}}", out.V{"image": vals[1], "name": defaultImage}) + if _, ok := opts.Images[vals[0]]; ok { + opts.Images[vals[0]] = vals[1] + } else { + out.WarningT("Ignoring unknown custom image {{.name}}", out.V{"name": vals[0]}) } - opts.Images[vals[0]] = vals[1] } } + if opts.Registries == nil { + opts.Registries = make(map[string]string) + } + + registries := viper.GetString(config.AddonRegistries) + if registries != "" { + for _, registry := range strings.Split(registries, ",") { + vals := strings.Split(registry, "=") + if len(vals) != 2 { + out.WarningT("Ignoring invalid custom registry {{.conf}}", out.V{"conf": registry}) + continue + } + if _, ok := opts.Registries[vals[0]]; ok { + opts.Registries[vals[0]] = vals[1] + } else { + out.WarningT("Ignoring unknown custom registry {{.name}}", out.V{"name": vals[0]}) + } + } + } + + // Append postfix "/" to registries + for k, v := range opts.Registries { + if !strings.HasSuffix(opts.Registries[k], "/") { + opts.Registries[k] = v + "/" + } + } + + for name, image := range opts.Images { + if _, ok := opts.Registries[name]; !ok { + opts.Registries[name] = "" // Avoid nil access when rendering + } + // Send messages to stderr due to some tests rely on stdout + out.ErrT(style.Option, "Using image {{.registry}}{{.image}}", out.V{"registry": opts.Registries[name], "image": image}) + } return opts } diff --git a/pkg/minikube/config/config.go b/pkg/minikube/config/config.go index 09bed9ced2be..dc1e4827bf0c 100644 --- a/pkg/minikube/config/config.go +++ b/pkg/minikube/config/config.go @@ -52,6 +52,8 @@ const ( UserFlag = "user" // AddonImages stores custom addon images config AddonImages = "addon-images" + // AddonRegistries stores custom addon images config + AddonRegistries = "addon-registries" ) var ( diff --git a/site/content/en/docs/commands/addons.md b/site/content/en/docs/commands/addons.md index 36333a369d62..83fc545d453e 100644 --- a/site/content/en/docs/commands/addons.md +++ b/site/content/en/docs/commands/addons.md @@ -109,20 +109,27 @@ minikube addons disable ADDON_NAME [flags] ## minikube addons enable -Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list +Enables the addon w/ADDON_NAME within minikube. For a list of available addons use: minikube addons list ### Synopsis -Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list +Enables the addon w/ADDON_NAME within minikube. For a list of available addons use: minikube addons list ```shell minikube addons enable ADDON_NAME [flags] ``` +### Examples + +``` +minikube addons enable dashboard +``` + ### Options ``` - --images string Alpha feature. Image names used by this addon. Divided by comma. + --images string Images used by this addon. Divided by comma. + --registries string Registries used by this addon. Divided by comma. ``` ### Options inherited from parent commands From 046858778f293201753b7be95ee970f554cf02fc Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Tue, 12 Jan 2021 13:16:18 +0800 Subject: [PATCH 07/11] Ignore empty params Signed-off-by: Ling Samuel --- pkg/minikube/assets/addons.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 699f0f18eae5..3868fc68d50a 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -634,7 +634,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} if images != "" { for _, image := range strings.Split(images, ",") { vals := strings.Split(image, "=") - if len(vals) != 2 { + if len(vals) != 2 || vals[1] == "" { out.WarningT("Ignoring invalid custom image {{.conf}}", out.V{"conf": image}) continue } @@ -654,7 +654,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} if registries != "" { for _, registry := range strings.Split(registries, ",") { vals := strings.Split(registry, "=") - if len(vals) != 2 { + if len(vals) != 2 || vals[1] == "" { out.WarningT("Ignoring invalid custom registry {{.conf}}", out.V{"conf": registry}) continue } @@ -668,7 +668,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} // Append postfix "/" to registries for k, v := range opts.Registries { - if !strings.HasSuffix(opts.Registries[k], "/") { + if opts.Registries[k] != "" && !strings.HasSuffix(opts.Registries[k], "/") { opts.Registries[k] = v + "/" } } From 675633691f2b7ec8e588905d4e8e6694a59e54c0 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Wed, 13 Jan 2021 10:40:42 +0800 Subject: [PATCH 08/11] Allow empty custom registry --- pkg/minikube/assets/addons.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 3868fc68d50a..ff664350898f 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -654,7 +654,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} if registries != "" { for _, registry := range strings.Split(registries, ",") { vals := strings.Split(registry, "=") - if len(vals) != 2 || vals[1] == "" { + if len(vals) != 2 { out.WarningT("Ignoring invalid custom registry {{.conf}}", out.V{"conf": registry}) continue } From c9f4cb8388e8bbab7d94477da4b8fa1139cf1d0a Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Wed, 13 Jan 2021 11:00:56 +0800 Subject: [PATCH 09/11] addons custom images/registries example article Signed-off-by: Ling Samuel --- .../en/docs/handbook/addons/custom-images.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 site/content/en/docs/handbook/addons/custom-images.md diff --git a/site/content/en/docs/handbook/addons/custom-images.md b/site/content/en/docs/handbook/addons/custom-images.md new file mode 100644 index 000000000000..350bf709bb2b --- /dev/null +++ b/site/content/en/docs/handbook/addons/custom-images.md @@ -0,0 +1,57 @@ +--- +title: "Config the Addon to Use Custom Registries and Images" +linkTitle: "Custom Images" +weight: 2 +date: 2021-01-13 +--- + +If you have trouble to access default images, or want to use images from a private registry or local version, you could achieve +this by flag `--images` and `--registries`. + +We defined and named all images used by an addon, you could view them by command `addons images`: + +```shell +minikube addons images efk +``` + +``` + ▪ efk has following images: +|----------------------|------------------------------|-------------------| +| IMAGE NAME | DEFAULT IMAGE | DEFAULT REGISTRY | +|----------------------|------------------------------|-------------------| +| Elasticsearch | elasticsearch:v5.6.2 | k8s.gcr.io | +| FluentdElasticsearch | fluentd-elasticsearch:v2.0.2 | k8s.gcr.io | +| Alpine | alpine:3.6 | | +| Kibana | kibana/kibana:5.6.2 | docker.elastic.co | +|----------------------|------------------------------|-------------------| +``` + +The `DEFAULT IMAGE` and `DEFAULT REGISTRY` columns indicate which images are used by default. +An empty registry means the image is stored locally or default registry `docker.io`. + +The `IMAGE NAME` column is used to customize the corresponding image and registry. + +Assume we have a private registry at `localhost:5555` to replace `k8s.gcr.io` and a locally built Kibana called `kibana/kibana:5.6.2-custom`. + +We could load local images to minikube by: + +```shell +minikube cache add kibana/kibana:5.6.2-custom +``` + +Then we can start `efk` addon with flags `--images` and `--registries`. +The format is `IMAGE_NAME=CUSTOM_VALUE`, separated by commas, where the `IMAGE_NAME` is the value of `IMAGE NAME` column in the table above. + +```shell +minikube addons enable efk --images="Kibana=kibana/kibana:5.6.2-custom" --registries="Kibana=,Elasticsearch=localhost:5555,FluentdElasticsearch=localhost:5555" +``` + +``` + ▪ Using image localhost:5555/elasticsearch:v5.6.2 + ▪ Using image localhost:5555/fluentd-elasticsearch:v2.0.2 + ▪ Using image alpine:3.6 + ▪ Using image kibana/kibana:5.6.2-custom +🌟 The 'efk' addon is enabled +``` + +Now the `efk` addon is using the custom registry and images. \ No newline at end of file From 101d39fc5113e1e57367bb0b628edaab6b6d94e8 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Wed, 13 Jan 2021 12:01:37 +0800 Subject: [PATCH 10/11] Addon custom registry: * fix missing suffix when using global image repo * support override global image repo * change all imagePullPolicy to IfNotPresent * fix empty global image repo suffix Signed-off-by: Ling Samuel --- cmd/minikube/cmd/config/enable.go | 4 +-- .../ambassador/ambassador-operator.yaml.tmpl | 4 +-- .../deploy/csi-hostpath-attacher.yaml.tmpl | 2 +- .../deploy/csi-hostpath-plugin.yaml.tmpl | 6 ++-- .../deploy/csi-hostpath-provisioner.yaml.tmpl | 2 +- .../deploy/csi-hostpath-resizer.yaml.tmpl | 2 +- .../deploy/csi-hostpath-snapshotter.yaml.tmpl | 2 +- .../addons/dashboard/dashboard-dp.yaml.tmpl | 4 +-- deploy/addons/efk/elasticsearch-rc.yaml.tmpl | 4 +-- deploy/addons/efk/fluentd-es-rc.yaml.tmpl | 2 +- deploy/addons/efk/kibana-rc.yaml.tmpl | 2 +- deploy/addons/freshpod/freshpod-rc.yaml.tmpl | 2 +- .../gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl | 6 ++-- .../gpu/nvidia-driver-installer.yaml.tmpl | 2 +- .../gpu/nvidia-gpu-device-plugin.yaml.tmpl | 2 +- deploy/addons/gvisor/gvisor-pod.yaml.tmpl | 2 +- deploy/addons/helm-tiller/helm-tiller-dp.tmpl | 2 +- .../ingress-dns/ingress-dns-pod.yaml.tmpl | 2 +- deploy/addons/ingress/ingress-dp.yaml.tmpl | 6 ++-- .../istio-operator.yaml.tmpl | 4 +-- deploy/addons/kubevirt/pod.yaml.tmpl | 2 +- .../logviewer/logviewer-dp-and-svc.yaml.tmpl | 4 +-- deploy/addons/metallb/metallb.yaml.tmpl | 4 +-- .../metrics-server-deployment.yaml.tmpl | 2 +- deploy/addons/olm/olm.yaml.tmpl | 10 +++--- .../node-etc-hosts-update.tmpl | 4 +-- .../registry-creds-rc.yaml.tmpl | 4 +-- .../addons/registry/registry-proxy.yaml.tmpl | 2 +- deploy/addons/registry/registry-rc.yaml.tmpl | 2 +- .../glusterfs-daemonset.yaml.tmpl | 2 +- .../heketi-deployment.yaml.tmpl | 2 +- .../storage-provisioner-glusterfile.yaml.tmpl | 4 +-- .../storage-provisioner.yaml.tmpl | 2 +- ...e-snapshot-controller-deployment.yaml.tmpl | 4 +-- pkg/minikube/assets/addons.go | 35 ++++++++++++++++--- site/content/en/docs/commands/addons.md | 4 +-- 36 files changed, 88 insertions(+), 61 deletions(-) diff --git a/cmd/minikube/cmd/config/enable.go b/cmd/minikube/cmd/config/enable.go index f79a07ab4c49..14a833cd1434 100644 --- a/cmd/minikube/cmd/config/enable.go +++ b/cmd/minikube/cmd/config/enable.go @@ -74,7 +74,7 @@ var ( ) func init() { - addonsEnableCmd.Flags().StringVar(&images, "images", "", "Images used by this addon. Divided by comma.") - addonsEnableCmd.Flags().StringVar(®istries, "registries", "", "Registries used by this addon. Divided by comma.") + addonsEnableCmd.Flags().StringVar(&images, "images", "", "Images used by this addon. Separated by commas.") + addonsEnableCmd.Flags().StringVar(®istries, "registries", "", "Registries used by this addon. Separated by commas.") AddonsCmd.AddCommand(addonsEnableCmd) } diff --git a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl index a2391acb0644..be939fef2ab4 100644 --- a/deploy/addons/ambassador/ambassador-operator.yaml.tmpl +++ b/deploy/addons/ambassador/ambassador-operator.yaml.tmpl @@ -180,10 +180,10 @@ spec: containers: - name: ambassador-operator # Replace this with the built image name - image: {{default .Registries.AmbassadorOperator .ImageRepository}}{{.Images.AmbassadorOperator}} + image: {{.CustomRegistries.AmbassadorOperator | default .ImageRepository | default .Registries.AmbassadorOperator }}{{.Images.AmbassadorOperator}} command: - ambassador-operator - imagePullPolicy: Always + imagePullPolicy: IfNotPresent env: - name: WATCH_NAMESPACE valueFrom: diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl index e37357afbc30..6f3026544d48 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-attacher containers: - name: csi-attacher - image: {{default .Registries.Attacher .ImageRepository}}{{.Images.Attacher}} + image: {{.CustomRegistries.Attacher | default .ImageRepository | default .Registries.Attacher }}{{.Images.Attacher}} args: - --v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl index 552f6619fc65..ed884880dcc0 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl @@ -53,7 +53,7 @@ spec: spec: containers: - name: node-driver-registrar - image: {{default .Registries.NodeDriverRegistrar .ImageRepository}}{{.Images.NodeDriverRegistrar}} + image: {{.CustomRegistries.NodeDriverRegistrar | default .ImageRepository | default .Registries.NodeDriverRegistrar }}{{.Images.NodeDriverRegistrar}} args: - --v=5 - --csi-address=/csi/csi.sock @@ -78,7 +78,7 @@ spec: name: csi-data-dir - name: hostpath - image: {{default .Registries.HostPathPlugin .ImageRepository}}{{.Images.HostPathPlugin}} + image: {{.CustomRegistries.HostPathPlugin | default .ImageRepository | default .Registries.HostPathPlugin }}{{.Images.HostPathPlugin}} args: - "--drivername=hostpath.csi.k8s.io" - "--v=5" @@ -123,7 +123,7 @@ spec: volumeMounts: - mountPath: /csi name: socket-dir - image: {{default .Registries.LivenessProbe .ImageRepository}}{{.Images.LivenessProbe}} + image: {{.CustomRegistries.LivenessProbe | default .ImageRepository | default .Registries.LivenessProbe }}{{.Images.LivenessProbe}} args: - --csi-address=/csi/csi.sock - --health-port=9898 diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl index b88dd7c0aade..b974204eb8bc 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-provisioner containers: - name: csi-provisioner - image: {{default .Registries.Provisioner .ImageRepository}}{{.Images.Provisioner}} + image: {{.CustomRegistries.Provisioner | default .ImageRepository | default .Registries.Provisioner }}{{.Images.Provisioner}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl index 36cad376e22f..1d881293ee54 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccountName: csi-resizer containers: - name: csi-resizer - image: {{default .Registries.Resizer .ImageRepository}}{{.Images.Resizer}} + image: {{.CustomRegistries.Resizer | default .ImageRepository | default .Registries.Resizer }}{{.Images.Resizer}} args: - -v=5 - -csi-address=/csi/csi.sock diff --git a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl index 0190e28e0e9b..1da7e3fa9350 100644 --- a/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl +++ b/deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl @@ -57,7 +57,7 @@ spec: serviceAccount: csi-snapshotter containers: - name: csi-snapshotter - image: {{default .Registries.Snapshotter .ImageRepository}}{{.Images.Snapshotter}} + image: {{.CustomRegistries.Snapshotter | default .ImageRepository | default .Registries.Snapshotter }}{{.Images.Snapshotter}} args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl index bdec475f55ca..ef76cdd6ad04 100644 --- a/deploy/addons/dashboard/dashboard-dp.yaml.tmpl +++ b/deploy/addons/dashboard/dashboard-dp.yaml.tmpl @@ -36,7 +36,7 @@ spec: spec: containers: - name: dashboard-metrics-scraper - image: {{default .Registries.MetricsScraper .ImageRepository}}{{.Images.MetricsScraper}} + image: {{.CustomRegistries.MetricsScraper | default .ImageRepository | default .Registries.MetricsScraper }}{{.Images.MetricsScraper}} ports: - containerPort: 8000 protocol: TCP @@ -91,7 +91,7 @@ spec: containers: - name: kubernetes-dashboard # WARNING: This must match pkg/minikube/bootstrapper/images/images.go - image: {{default .Registries.Dashboard .ImageRepository}}{{.Images.Dashboard}} + image: {{.CustomRegistries.Dashboard | default .ImageRepository | default .Registries.Dashboard }}{{.Images.Dashboard}} ports: - containerPort: 9090 protocol: TCP diff --git a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl index 59f5231f7d6d..466891219f87 100644 --- a/deploy/addons/efk/elasticsearch-rc.yaml.tmpl +++ b/deploy/addons/efk/elasticsearch-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: elasticsearch-logging - image: {{default .Registries.Elasticsearch .ImageRepository}}{{.Images.Elasticsearch}} + image: {{.CustomRegistries.Elasticsearch | default .ImageRepository | default .Registries.Elasticsearch }}{{.Images.Elasticsearch}} resources: limits: cpu: 500m @@ -62,7 +62,7 @@ spec: - name: ES_JAVA_OPTS value: "-Xms1024m -Xmx1024m" initContainers: - - image: {{default .Registries.Alpine .ImageRepository}}{{.Images.Alpine}} + - image: {{.CustomRegistries.Alpine | default .ImageRepository | default .Registries.Alpine }}{{.Images.Alpine}} command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"] name: elasticsearch-logging-init securityContext: diff --git a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl index a1669c253645..d43282982c5e 100644 --- a/deploy/addons/efk/fluentd-es-rc.yaml.tmpl +++ b/deploy/addons/efk/fluentd-es-rc.yaml.tmpl @@ -31,7 +31,7 @@ spec: spec: containers: - name: fluentd-es - image: {{default .Registries.FluentdElasticsearch .ImageRepository}}{{.Images.FluentdElasticsearch}} + image: {{.CustomRegistries.FluentdElasticsearch | default .ImageRepository | default .Registries.FluentdElasticsearch }}{{.Images.FluentdElasticsearch}} env: - name: FLUENTD_ARGS value: --no-supervisor -q diff --git a/deploy/addons/efk/kibana-rc.yaml.tmpl b/deploy/addons/efk/kibana-rc.yaml.tmpl index e13faa98b16f..ed541e49b08f 100644 --- a/deploy/addons/efk/kibana-rc.yaml.tmpl +++ b/deploy/addons/efk/kibana-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: kibana-logging - image: {{default .Registries.Kibana .ImageRepository}}{{.Images.Kibana}} + image: {{.CustomRegistries.Kibana | default .ImageRepository | default .Registries.Kibana }}{{.Images.Kibana}} resources: limits: cpu: 500m diff --git a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl index c5112c8c8c10..70e380794017 100644 --- a/deploy/addons/freshpod/freshpod-rc.yaml.tmpl +++ b/deploy/addons/freshpod/freshpod-rc.yaml.tmpl @@ -34,7 +34,7 @@ spec: spec: containers: - name: freshpod - image: {{default .Registries.FreshPod .ImageRepository}}{{.Images.FreshPod}} + image: {{.CustomRegistries.FreshPod | default .ImageRepository | default .Registries.FreshPod }}{{.Images.FreshPod}} imagePullPolicy: IfNotPresent volumeMounts: - name: docker diff --git a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl index a2f24e6c8d93..149a84a7887c 100644 --- a/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl +++ b/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl.tmpl @@ -68,7 +68,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: create - image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}{{.Images.KubeWebhookCertgen}} + image: {{.CustomRegistries.KubeWebhookCertgen | default .ImageRepository | default .Registries.KubeWebhookCertgen }}{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - create @@ -94,7 +94,7 @@ spec: spec: containers: - name: gcp-auth - image: {{default .Registries.GCPAuthWebhook .ImageRepository}}{{.Images.GCPAuthWebhook}} + image: {{.CustomRegistries.GCPAuthWebhook | default .ImageRepository | default .Registries.GCPAuthWebhook }}{{.Images.GCPAuthWebhook}} imagePullPolicy: IfNotPresent ports: - containerPort: 8443 @@ -127,7 +127,7 @@ spec: serviceAccountName: minikube-gcp-auth-certs containers: - name: patch - image: {{default .Registries.KubeWebhookCertgen .ImageRepository}}{{.Images.KubeWebhookCertgen}} + image: {{.CustomRegistries.KubeWebhookCertgen | default .ImageRepository | default .Registries.KubeWebhookCertgen }}{{.Images.KubeWebhookCertgen}} imagePullPolicy: IfNotPresent args: - patch diff --git a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl index 27d4e99f5bcf..0c4978a82685 100644 --- a/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-driver-installer.yaml.tmpl @@ -50,7 +50,7 @@ spec: hostPath: path: / initContainers: - - image: {{default .Registries.NvidiaDriverInstaller .ImageRepository}}{{.Images.NvidiaDriverInstaller}} + - image: {{.CustomRegistries.NvidiaDriverInstaller | default .ImageRepository | default .Registries.NvidiaDriverInstaller }}{{.Images.NvidiaDriverInstaller}} name: nvidia-driver-installer resources: requests: diff --git a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl index a540fb77d732..e1e695866e11 100644 --- a/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl +++ b/deploy/addons/gpu/nvidia-gpu-device-plugin.yaml.tmpl @@ -43,7 +43,7 @@ spec: hostPath: path: /var/lib/kubelet/device-plugins containers: - - image: {{default .Registries.NvidiaDevicePlugin .ImageRepository}}{{.Images.NvidiaDevicePlugin}} + - image: {{.CustomRegistries.NvidiaDevicePlugin | default .ImageRepository | default .Registries.NvidiaDevicePlugin }}{{.Images.NvidiaDevicePlugin}} command: ["/usr/bin/nvidia-device-plugin", "-logtostderr"] name: nvidia-gpu-device-plugin resources: diff --git a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl index 7e9ad3666472..648ef38ef9af 100644 --- a/deploy/addons/gvisor/gvisor-pod.yaml.tmpl +++ b/deploy/addons/gvisor/gvisor-pod.yaml.tmpl @@ -25,7 +25,7 @@ spec: hostPID: true containers: - name: gvisor - image: {{default .Registries.GvisorAddon .ImageRepository}}{{.Images.GvisorAddon}} + image: {{.CustomRegistries.GvisorAddon | default .ImageRepository | default .Registries.GvisorAddon }}{{.Images.GvisorAddon}} securityContext: privileged: true volumeMounts: diff --git a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl index 023d2feed4da..ed44d410cf04 100644 --- a/deploy/addons/helm-tiller/helm-tiller-dp.tmpl +++ b/deploy/addons/helm-tiller/helm-tiller-dp.tmpl @@ -46,7 +46,7 @@ spec: value: kube-system - name: TILLER_HISTORY_MAX value: "0" - image: {{default .Registries.Tiller .ImageRepository}}{{.Images.Tiller}} + image: {{.CustomRegistries.Tiller | default .ImageRepository | default .Registries.Tiller }}{{.Images.Tiller}} imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 diff --git a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl index abf54da11cc1..bb0e7c1b3fab 100644 --- a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl +++ b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl @@ -80,7 +80,7 @@ spec: hostNetwork: true containers: - name: minikube-ingress-dns - image: {{default .Registries.IngressDNS .ImageRepository}}{{.Images.IngressDNS}} + image: {{.CustomRegistries.IngressDNS | default .ImageRepository | default .Registries.IngressDNS }}{{.Images.IngressDNS}} imagePullPolicy: IfNotPresent ports: - containerPort: 53 diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index 4b29c64c83be..39bc372a3c18 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -49,7 +49,7 @@ spec: serviceAccountName: ingress-nginx containers: - name: controller - image: {{default .Registries.IngressController .ImageRepository}}{{.Images.IngressController}} + image: {{.CustomRegistries.IngressController | default .ImageRepository | default .Registries.IngressController }}{{.Images.IngressController}} imagePullPolicy: IfNotPresent lifecycle: preStop: @@ -220,7 +220,7 @@ spec: spec: containers: - name: create - image: {{default .Registries.KubeWebhookCertgenCreate .ImageRepository}}{{.Images.KubeWebhookCertgenCreate}} + image: {{.CustomRegistries.KubeWebhookCertgenCreate | default .ImageRepository | default .Registries.KubeWebhookCertgenCreate }}{{.Images.KubeWebhookCertgenCreate}} imagePullPolicy: IfNotPresent args: - create @@ -255,7 +255,7 @@ spec: spec: containers: - name: patch - image: {{default .Registries.KubeWebhookCertgenPatch .ImageRepository}}{{.Images.KubeWebhookCertgenPatch}} + image: {{.CustomRegistries.KubeWebhookCertgenPatch | default .ImageRepository | default .Registries.KubeWebhookCertgenPatch }}{{.Images.KubeWebhookCertgenPatch}} imagePullPolicy: args: - patch diff --git a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl index d907629316ab..6c5f23118b79 100644 --- a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl +++ b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl @@ -218,11 +218,11 @@ spec: serviceAccountName: istio-operator containers: - name: istio-operator - image: {{default .Registries.IstioOperator .ImageRepository}}{{.Images.IstioOperator}} + image: {{.CustomRegistries.IstioOperator | default .ImageRepository | default .Registries.IstioOperator }}{{.Images.IstioOperator}} command: - operator - server - imagePullPolicy: Always + imagePullPolicy: IfNotPresent resources: limits: cpu: 200m diff --git a/deploy/addons/kubevirt/pod.yaml.tmpl b/deploy/addons/kubevirt/pod.yaml.tmpl index 50279f5badf2..ae575b783ae7 100644 --- a/deploy/addons/kubevirt/pod.yaml.tmpl +++ b/deploy/addons/kubevirt/pod.yaml.tmpl @@ -50,7 +50,7 @@ spec: - /bin/bash - -c - /kubevirt-scripts/install.sh - image: {{default .Registries.Kubectl .ImageRepository}}{{.Images.Kubectl}} + image: {{.CustomRegistries.Kubectl | default .ImageRepository | default .Registries.Kubectl }}{{.Images.Kubectl}} imagePullPolicy: IfNotPresent name: kubevirt-provisioner lifecycle: diff --git a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl index c4ff7100e424..2c10bc9f7624 100644 --- a/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl +++ b/deploy/addons/logviewer/logviewer-dp-and-svc.yaml.tmpl @@ -41,8 +41,8 @@ spec: serviceAccountName: sa-logviewer containers: - name: logviewer - imagePullPolicy: Always - image: {{default .Registries.LogViewer .ImageRepository}}{{.Images.LogViewer}} + imagePullPolicy: IfNotPresent + image: {{.CustomRegistries.LogViewer | default .ImageRepository | default .Registries.LogViewer }}{{.Images.LogViewer}} volumeMounts: - name: logs mountPath: /var/log/containers/ diff --git a/deploy/addons/metallb/metallb.yaml.tmpl b/deploy/addons/metallb/metallb.yaml.tmpl index 911e170038ff..7d033b69e7cf 100644 --- a/deploy/addons/metallb/metallb.yaml.tmpl +++ b/deploy/addons/metallb/metallb.yaml.tmpl @@ -212,7 +212,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: {{default .Registries.Speaker .ImageRepository}}{{.Images.Speaker}} + image: {{.CustomRegistries.Speaker | default .ImageRepository | default .Registries.Speaker }}{{.Images.Speaker}} imagePullPolicy: IfNotPresent name: speaker ports: @@ -268,7 +268,7 @@ spec: - args: - --port=7472 - --config=config - image: {{default .Registries.Controller .ImageRepository}}{{.Images.Controller}} + image: {{.CustomRegistries.Controller | default .ImageRepository | default .Registries.Controller }}{{.Images.Controller}} imagePullPolicy: IfNotPresent name: controller ports: diff --git a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl index 630042fd2ce3..19a92e27a805 100644 --- a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl +++ b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl @@ -19,7 +19,7 @@ spec: spec: containers: - name: metrics-server - image: {{default .Registries.MetricsServer .ImageRepository}}{{.Images.MetricsServer}} + image: {{.CustomRegistries.MetricsServer | default .ImageRepository | default .Registries.MetricsServer }}{{.Images.MetricsServer}} imagePullPolicy: IfNotPresent command: - /metrics-server diff --git a/deploy/addons/olm/olm.yaml.tmpl b/deploy/addons/olm/olm.yaml.tmpl index 69344cc7141b..c3dd5755eb62 100644 --- a/deploy/addons/olm/olm.yaml.tmpl +++ b/deploy/addons/olm/olm.yaml.tmpl @@ -82,7 +82,7 @@ spec: - $(OPERATOR_NAMESPACE) - -writeStatusName - "" - image: {{default .Registries.OLM .ImageRepository}}{{.Images.OLM}} + image: {{.CustomRegistries.OLM | default .ImageRepository | default .Registries.OLM }}{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -143,7 +143,7 @@ spec: - '-namespace' - olm - -configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest - image: {{default .Registries.OLM .ImageRepository}}{{.Images.OLM}} + image: {{.CustomRegistries.OLM | default .ImageRepository | default .Registries.OLM }}{{.Images.OLM}} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 @@ -307,8 +307,8 @@ spec: - "5443" - --global-namespace - olm - image: {{default .Registries.OLM .ImageRepository}}{{.Images.OLM}} - imagePullPolicy: Always + image: {{.CustomRegistries.OLM | default .ImageRepository | default .Registries.OLM }}{{.Images.OLM}} + imagePullPolicy: IfNotPresent ports: - containerPort: 5443 livenessProbe: @@ -346,6 +346,6 @@ metadata: namespace: olm spec: sourceType: grpc - image: {{default .Registries.UpstreamCommunityOperators .ImageRepository}}{{.Images.UpstreamCommunityOperators}} + image: {{.CustomRegistries.UpstreamCommunityOperators | default .ImageRepository | default .Registries.UpstreamCommunityOperators }}{{.Images.UpstreamCommunityOperators}} displayName: Community Operators publisher: OperatorHub.io \ No newline at end of file diff --git a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl index 5ceee2ef695a..4df44d41952e 100644 --- a/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl +++ b/deploy/addons/registry-aliases/node-etc-hosts-update.tmpl @@ -17,7 +17,7 @@ spec: spec: initContainers: - name: update - image: {{default .Registries.Alpine .ImageRepository}}{{.Images.Alpine}} + image: {{.CustomRegistries.Alpine | default .ImageRepository | default .Registries.Alpine }}{{.Images.Alpine}} volumeMounts: - name: etchosts mountPath: /host-etc/hosts @@ -43,7 +43,7 @@ spec: echo "Done." containers: - name: pause-for-update - image: {{default .Registries.Pause .ImageRepository}}{{.Images.Pause}} + image: {{.CustomRegistries.Pause | default .ImageRepository | default .Registries.Pause }}{{.Images.Pause}} terminationGracePeriodSeconds: 30 volumes: - name: etchosts diff --git a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl index 729fc0c82ba9..b6cc7e2d556f 100644 --- a/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl +++ b/deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl @@ -18,9 +18,9 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default .Registries.RegistryCreds .ImageRepository}}{{.Images.RegistryCreds}} + - image: {{.CustomRegistries.RegistryCreds | default .ImageRepository | default .Registries.RegistryCreds }}{{.Images.RegistryCreds}} name: registry-creds - imagePullPolicy: Always + imagePullPolicy: IfNotPresent env: - name: AWS_ACCESS_KEY_ID valueFrom: diff --git a/deploy/addons/registry/registry-proxy.yaml.tmpl b/deploy/addons/registry/registry-proxy.yaml.tmpl index 4c083e4b48dc..487066156c10 100644 --- a/deploy/addons/registry/registry-proxy.yaml.tmpl +++ b/deploy/addons/registry/registry-proxy.yaml.tmpl @@ -19,7 +19,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default .Registries.KubeRegistryProxy .ImageRepository}}{{.Images.KubeRegistryProxy}} + - image: {{.CustomRegistries.KubeRegistryProxy | default .ImageRepository | default .Registries.KubeRegistryProxy }}{{.Images.KubeRegistryProxy}} imagePullPolicy: IfNotPresent name: registry-proxy ports: diff --git a/deploy/addons/registry/registry-rc.yaml.tmpl b/deploy/addons/registry/registry-rc.yaml.tmpl index 73cbb67147cc..eb6d782ba043 100644 --- a/deploy/addons/registry/registry-rc.yaml.tmpl +++ b/deploy/addons/registry/registry-rc.yaml.tmpl @@ -18,7 +18,7 @@ spec: addonmanager.kubernetes.io/mode: Reconcile spec: containers: - - image: {{default .Registries.Registry .ImageRepository}}{{.Images.Registry}} + - image: {{.CustomRegistries.Registry | default .ImageRepository | default .Registries.Registry }}{{.Images.Registry}} imagePullPolicy: IfNotPresent name: registry ports: diff --git a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl index f4c4a2a5c89e..df4f8d602e47 100644 --- a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl @@ -31,7 +31,7 @@ spec: # kubernetes.io/hostname: minikube hostNetwork: true containers: - - image: {{default .Registries.GlusterfsServer .ImageRepository}}{{.Images.GlusterfsServer}} + - image: {{.CustomRegistries.GlusterfsServer | default .ImageRepository | default .Registries.GlusterfsServer }}{{.Images.GlusterfsServer}} imagePullPolicy: IfNotPresent name: glusterfs env: diff --git a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl index e604e810c2bd..db8970bd4738 100644 --- a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl @@ -116,7 +116,7 @@ spec: spec: serviceAccountName: heketi-service-account containers: - - image: {{default .Registries.Heketi .ImageRepository}}{{.Images.Heketi}} + - image: {{.CustomRegistries.Heketi | default .ImageRepository | default .Registries.Heketi }}{{.Images.Heketi}} imagePullPolicy: IfNotPresent name: heketi env: diff --git a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl index 49b54b387ddc..11048d25b92b 100644 --- a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl @@ -106,8 +106,8 @@ spec: serviceAccountName: glusterfile-provisioner containers: - name: glusterfile-provisioner - image: {{default .Registries.GlusterfileProvisioner .ImageRepository}}{{.Images.GlusterfileProvisioner}} - imagePullPolicy: Always + image: {{.CustomRegistries.GlusterfileProvisioner | default .ImageRepository | default .Registries.GlusterfileProvisioner }}{{.Images.GlusterfileProvisioner}} + imagePullPolicy: IfNotPresent env: - name: PROVISIONER_NAME value: gluster.org/glusterfile diff --git a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl index fff4bf89c842..ba90e861a172 100644 --- a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl +++ b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl @@ -100,7 +100,7 @@ spec: hostNetwork: true containers: - name: storage-provisioner - image: {{default .Registries.StorageProvisioner .ImageRepository}}{{.Images.StorageProvisioner}} + image: {{.CustomRegistries.StorageProvisioner | default .ImageRepository | default .Registries.StorageProvisioner }}{{.Images.StorageProvisioner}} command: ["/storage-provisioner"] imagePullPolicy: IfNotPresent volumeMounts: diff --git a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl index 57bebeaba002..9706cd98e99f 100644 --- a/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl +++ b/deploy/addons/volumesnapshots/volume-snapshot-controller-deployment.yaml.tmpl @@ -23,7 +23,7 @@ spec: containers: - name: volume-snapshot-controller # TODO(xyang): Replace with an official image when it is released - image: {{default .Registries.SnapshotController .ImageRepository}}{{.Images.SnapshotController}} + image: {{.CustomRegistries.SnapshotController | default .ImageRepository | default .Registries.SnapshotController }}{{.Images.SnapshotController}} args: - "--v=5" - imagePullPolicy: Always + imagePullPolicy: IfNotPresent diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index ff664350898f..a0aae9248626 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -615,6 +615,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} CustomIngressCert string Images map[string]string Registries map[string]string + CustomRegistries map[string]string }{ Arch: a, ExoticArch: ea, @@ -624,6 +625,10 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} CustomIngressCert: cfg.CustomIngressCert, Images: addon.Images, Registries: addon.Registries, + CustomRegistries: make(map[string]string), + } + if opts.ImageRepository != "" && !strings.HasSuffix(opts.ImageRepository, "/") { + opts.ImageRepository += "/" } if opts.Images == nil { @@ -658,8 +663,8 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} out.WarningT("Ignoring invalid custom registry {{.conf}}", out.V{"conf": registry}) continue } - if _, ok := opts.Registries[vals[0]]; ok { - opts.Registries[vals[0]] = vals[1] + if _, ok := opts.Images[vals[0]]; ok { // check images map because registry map may omitted default registry + opts.CustomRegistries[vals[0]] = vals[1] } else { out.WarningT("Ignoring unknown custom registry {{.name}}", out.V{"name": vals[0]}) } @@ -668,17 +673,39 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig) interface{} // Append postfix "/" to registries for k, v := range opts.Registries { - if opts.Registries[k] != "" && !strings.HasSuffix(opts.Registries[k], "/") { + if v != "" && !strings.HasSuffix(v, "/") { opts.Registries[k] = v + "/" } } + for k, v := range opts.CustomRegistries { + if v != "" && !strings.HasSuffix(v, "/") { + opts.CustomRegistries[k] = v + "/" + } + } + for name, image := range opts.Images { if _, ok := opts.Registries[name]; !ok { opts.Registries[name] = "" // Avoid nil access when rendering } + // Send messages to stderr due to some tests rely on stdout - out.ErrT(style.Option, "Using image {{.registry}}{{.image}}", out.V{"registry": opts.Registries[name], "image": image}) + if override, ok := opts.CustomRegistries[name]; ok { + out.ErrT(style.Option, "Using image {{.registry}}{{.image}}", out.V{ + "registry": override, + "image": image, + }) + } else if opts.ImageRepository != "" { + out.ErrT(style.Option, "Using image {{.registry}}{{.image}} (global image repository)", out.V{ + "registry": opts.ImageRepository, + "image": image, + }) + } else { + out.ErrT(style.Option, "Using image {{.registry}}{{.image}}", out.V{ + "registry": opts.Registries[name], + "image": image, + }) + } } return opts } diff --git a/site/content/en/docs/commands/addons.md b/site/content/en/docs/commands/addons.md index 83fc545d453e..4ed98cb6228a 100644 --- a/site/content/en/docs/commands/addons.md +++ b/site/content/en/docs/commands/addons.md @@ -128,8 +128,8 @@ minikube addons enable dashboard ### Options ``` - --images string Images used by this addon. Divided by comma. - --registries string Registries used by this addon. Divided by comma. + --images string Images used by this addon. Separated by commas. + --registries string Registries used by this addon. Separated by commas. ``` ### Options inherited from parent commands From 79cb6b42c11fcd443dfa2b7ca4c0aa548317d382 Mon Sep 17 00:00:00 2001 From: Ling Samuel Date: Wed, 27 Jan 2021 10:44:29 +0800 Subject: [PATCH 11/11] Generate docs, update addon example registry Signed-off-by: Ling Samuel --- site/content/en/docs/commands/addons.md | 1 + site/content/en/docs/handbook/addons/custom-images.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/site/content/en/docs/commands/addons.md b/site/content/en/docs/commands/addons.md index 4ed98cb6228a..51023fa24dd9 100644 --- a/site/content/en/docs/commands/addons.md +++ b/site/content/en/docs/commands/addons.md @@ -224,6 +224,7 @@ minikube addons images ingress --skip_headers If true, avoid header prefixes in the log messages --skip_log_headers If true, avoid headers when opening log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + --user string Specifies the user executing the operation. Useful for auditing operations executed by 3rd party tools. Defaults to the operating system username. -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging ``` diff --git a/site/content/en/docs/handbook/addons/custom-images.md b/site/content/en/docs/handbook/addons/custom-images.md index 350bf709bb2b..a66c44ee092b 100644 --- a/site/content/en/docs/handbook/addons/custom-images.md +++ b/site/content/en/docs/handbook/addons/custom-images.md @@ -31,7 +31,7 @@ An empty registry means the image is stored locally or default registry `docker. The `IMAGE NAME` column is used to customize the corresponding image and registry. -Assume we have a private registry at `localhost:5555` to replace `k8s.gcr.io` and a locally built Kibana called `kibana/kibana:5.6.2-custom`. +Assume we have a private registry at `192.168.10.2:5555` to replace `k8s.gcr.io` and a locally built Kibana called `kibana/kibana:5.6.2-custom`. We could load local images to minikube by: @@ -43,12 +43,12 @@ Then we can start `efk` addon with flags `--images` and `--registries`. The format is `IMAGE_NAME=CUSTOM_VALUE`, separated by commas, where the `IMAGE_NAME` is the value of `IMAGE NAME` column in the table above. ```shell -minikube addons enable efk --images="Kibana=kibana/kibana:5.6.2-custom" --registries="Kibana=,Elasticsearch=localhost:5555,FluentdElasticsearch=localhost:5555" +minikube addons enable efk --images="Kibana=kibana/kibana:5.6.2-custom" --registries="Kibana=,Elasticsearch=192.168.10.2:5555,FluentdElasticsearch=192.168.10.2:5555" ``` ``` - ▪ Using image localhost:5555/elasticsearch:v5.6.2 - ▪ Using image localhost:5555/fluentd-elasticsearch:v2.0.2 + ▪ Using image 192.168.10.2:5555/elasticsearch:v5.6.2 + ▪ Using image 192.168.10.2:5555/fluentd-elasticsearch:v2.0.2 ▪ Using image alpine:3.6 ▪ Using image kibana/kibana:5.6.2-custom 🌟 The 'efk' addon is enabled