diff --git a/cmd/minikube/cmd/config/enable.go b/cmd/minikube/cmd/config/enable.go index f79a07ab4c..14a833cd14 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 a2391acb06..be939fef2a 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 e37357afbc..6f3026544d 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 552f6619fc..ed884880dc 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 b88dd7c0aa..b974204eb8 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 36cad376e2..1d881293ee 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 0190e28e0e..1da7e3fa93 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 bdec475f55..ef76cdd6ad 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 59f5231f7d..466891219f 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 a1669c2536..d43282982c 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 e13faa98b1..ed541e49b0 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 c5112c8c8c..70e3807940 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 a2f24e6c8d..149a84a788 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 27d4e99f5b..0c4978a826 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 a540fb77d7..e1e695866e 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 7e9ad36664..648ef38ef9 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 023d2feed4..ed44d410cf 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 abf54da11c..bb0e7c1b3f 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 4b29c64c83..39bc372a3c 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 d907629316..6c5f23118b 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 50279f5bad..ae575b783a 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 c4ff7100e4..2c10bc9f76 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 911e170038..7d033b69e7 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 630042fd2c..19a92e27a8 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 69344cc714..c3dd5755eb 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 5ceee2ef69..4df44d4195 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 729fc0c82b..b6cc7e2d55 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 4c083e4b48..487066156c 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 73cbb67147..eb6d782ba0 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 f4c4a2a5c8..df4f8d602e 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 e604e810c2..db8970bd47 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 49b54b387d..11048d25b9 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 fff4bf89c8..ba90e861a1 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 57bebeaba0..9706cd98e9 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 ff66435089..a0aae92486 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 83fc545d45..4ed98cb622 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