From 4f0470de792e04914eaea69e7cf9a5db16cef907 Mon Sep 17 00:00:00 2001 From: spiarh <_me@spiarh.fr> Date: Thu, 13 Jan 2022 18:26:05 +0100 Subject: [PATCH] Use fully qualified domain image names by default (docker.io) It is more and more common that Container Runtimes do not resolve unqualified image names to docker.io for various reason. Setting docker.io/ prefix by default does not change the behavior at all but makes the life much easier for teams managing trident on clusters without unqualified image name resolution. This would also prevent deployment errors if an administrator does not pay attention to the image used in the manifests or in helm. --- cli/k8s_client/yaml_factory_test.go | 8 ++--- config/config.go | 5 +-- deploy/bundle.yaml | 2 +- .../tridentorchestrator_cr_autosupport.yaml | 2 +- ...identorchestrator_cr_imagepullsecrets.yaml | 2 +- deploy/operator.yaml | 2 +- docs/docker/deploying.rst | 2 +- docs/docker/install/host_config.rst | 2 +- docs/docker/install/multi_instance.rst | 4 +-- docs/docker/troubleshooting.rst | 2 +- docs/docker/use/managing.rst | 2 +- docs/kubernetes/deploying/operator-deploy.rst | 10 +++--- docs/kubernetes/upgrades/downgrading.rst | 4 +-- docs/reference/tridentctl.rst | 2 +- docs/support/requirements.rst | 36 +++++++++---------- helm/trident-operator/templates/_helpers.tpl | 6 ++-- .../orchestrator/installer/config.go | 2 +- 17 files changed, 47 insertions(+), 46 deletions(-) diff --git a/cli/k8s_client/yaml_factory_test.go b/cli/k8s_client/yaml_factory_test.go index 9afbb59b8..b81b6a4d6 100644 --- a/cli/k8s_client/yaml_factory_test.go +++ b/cli/k8s_client/yaml_factory_test.go @@ -131,8 +131,8 @@ func TestValidateGetCSIDeploymentYAMLSuccess(t *testing.T) { deploymentArgs := &DeploymentYAMLArguments{ DeploymentName: "trident-csi", - TridentImage: "netapp/trident:20.10.0-custom", - AutosupportImage: "netapp/trident-autosupport:20.10.0-custom", + TridentImage: "docker.io/netapp/trident:20.10.0-custom", + AutosupportImage: "docker.io/netapp/trident-autosupport:20.10.0-custom", AutosupportSerialNumber: "0000-0000", AutosupportHostname: "21e160d3-721f-4ec4-bcd4-c5e0d31d1a6e", AutosupportProxy: "http://127.0.0.1/", @@ -179,8 +179,8 @@ func TestValidateGetCSIDeploymentYAMLFail(t *testing.T) { deploymentArgs := &DeploymentYAMLArguments{ DeploymentName: "\ntrident-csi", - TridentImage: "netapp/trident:20.10.0-custom", - AutosupportImage: "netapp/trident-autosupport:20.10.0-custom", + TridentImage: "docker.io/netapp/trident:20.10.0-custom", + AutosupportImage: "docker.io/netapp/trident-autosupport:20.10.0-custom", AutosupportProxy: "http://127.0.0.1/", AutosupportCustomURL: "http://172.16.150.125:8888/", AutosupportSerialNumber: "0000-0000", diff --git a/config/config.go b/config/config.go index 90800a3ea..0e3650f76 100644 --- a/config/config.go +++ b/config/config.go @@ -109,6 +109,7 @@ const ( MinTLSVersion = tls.VersionTLS12 /* Docker constants */ + ImageRegistry = "docker.io" DockerPluginModeEnvVariable = "DOCKER_PLUGIN_MODE" // set via contrib/docker/plugin/plugin.json DockerPluginConfigLocation = "/etc/netappdvp" @@ -134,7 +135,7 @@ const ( /* Kubernetes operator constants */ OperatorContainerName = "trident-operator" - DefaultAutosupportImage = "netapp/trident-autosupport:21.10" + DefaultAutosupportImage = ImageRegistry + "/netapp/trident-autosupport:21.10" ) var ( @@ -157,7 +158,7 @@ var ( BuildTime = "unknown" // BuildImage is the Trident image that was built - BuildImage = "netapp/trident:" + DefaultOrchestratorVersion + "-custom.0" + BuildImage = ImageRegistry + "/netapp/trident:" + DefaultOrchestratorVersion + "-custom.0" OrchestratorVersion = utils.MustParseDate(version()) diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index 38df03410..cd8a88041 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -395,7 +395,7 @@ spec: fieldPath: metadata.name - name: OPERATOR_NAME value: trident-operator - image: netapp/trident-operator:22.01.0 + image: docker.io/netapp/trident-operator:22.01.0 imagePullPolicy: IfNotPresent name: trident-operator nodeSelector: diff --git a/deploy/crds/tridentorchestrator_cr_autosupport.yaml b/deploy/crds/tridentorchestrator_cr_autosupport.yaml index 46c1244ef..b69fb2d6d 100644 --- a/deploy/crds/tridentorchestrator_cr_autosupport.yaml +++ b/deploy/crds/tridentorchestrator_cr_autosupport.yaml @@ -6,5 +6,5 @@ spec: debug: true namespace: trident silenceAutosupport: false - autosupportImage: "netapp/trident-autosupport:21.10" + autosupportImage: "docker.io/netapp/trident-autosupport:21.10" autosupportProxy: "http://proxy.example.com:8888" diff --git a/deploy/crds/tridentorchestrator_cr_imagepullsecrets.yaml b/deploy/crds/tridentorchestrator_cr_imagepullsecrets.yaml index 8212351a5..fafbe0e3d 100644 --- a/deploy/crds/tridentorchestrator_cr_imagepullsecrets.yaml +++ b/deploy/crds/tridentorchestrator_cr_imagepullsecrets.yaml @@ -5,6 +5,6 @@ metadata: spec: debug: true namespace: trident - tridentImage: netapp/trident:22.01.0 + tridentImage: docker.io/netapp/trident:22.01.0 imagePullSecrets: - thisisasecret diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 182a435e8..c17a0684e 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -22,7 +22,7 @@ spec: serviceAccountName: trident-operator containers: - name: trident-operator - image: netapp/trident-operator:22.01.0 + image: docker.io/netapp/trident-operator:22.01.0 command: - "/trident-operator" - "--debug" diff --git a/docs/docker/deploying.rst b/docs/docker/deploying.rst index 580e6bebc..267b521a8 100644 --- a/docs/docker/deploying.rst +++ b/docs/docker/deploying.rst @@ -42,7 +42,7 @@ Deploying .. code-block:: bash - docker plugin install netapp/trident-plugin:21.07 --alias netapp --grant-all-permissions + docker plugin install docker.io/netapp/trident-plugin:21.07 --alias netapp --grant-all-permissions #. Begin using Trident to consume storage from the configured system. diff --git a/docs/docker/install/host_config.rst b/docs/docker/install/host_config.rst index 2d1242202..d0093db76 100644 --- a/docs/docker/install/host_config.rst +++ b/docs/docker/install/host_config.rst @@ -276,7 +276,7 @@ Docker Managed Plugin Method (Docker >= 1.13 / 17.03) .. code-block:: bash - docker plugin install --grant-all-permissions --alias netapp netapp/trident-plugin:21.07 config=myConfigFile.json + docker plugin install --grant-all-permissions --alias docker.io/netapp netapp/trident-plugin:21.07 config=myConfigFile.json #. Begin using Trident to consume storage from the configured system. diff --git a/docs/docker/install/multi_instance.rst b/docs/docker/install/multi_instance.rst index ab6ab87eb..f223fbda0 100644 --- a/docs/docker/install/multi_instance.rst +++ b/docs/docker/install/multi_instance.rst @@ -11,13 +11,13 @@ containerized plugin, or ``--volume-driver`` option when instantiating Trident o .. code-block:: bash - docker plugin install --grant-all-permissions --alias silver netapp/trident-plugin:21.07 config=silver.json + docker plugin install --grant-all-permissions --alias silver docker.io/netapp/trident-plugin:21.07 config=silver.json #. Launch the second instance, specifying a different alias and configuration file .. code-block:: bash - docker plugin install --grant-all-permissions --alias gold netapp/trident-plugin:21.07 config=gold.json + docker plugin install --grant-all-permissions --alias gold docker.io/netapp/trident-plugin:21.07 config=gold.json #. Create volumes specifying the alias as the driver name diff --git a/docs/docker/troubleshooting.rst b/docs/docker/troubleshooting.rst index db1d0e2c1..986418a17 100644 --- a/docs/docker/troubleshooting.rst +++ b/docs/docker/troubleshooting.rst @@ -44,7 +44,7 @@ find that's not enough, you can enable debug logging: .. code-block:: bash # install the plugin with debug logging enabled - docker plugin install netapp/trident-plugin: --alias debug=true + docker plugin install docker.io/netapp/trident-plugin: --alias debug=true # or, enable debug logging when the plugin is already installed docker plugin disable diff --git a/docs/docker/use/managing.rst b/docs/docker/use/managing.rst index 26ec9cab3..6136b499a 100644 --- a/docs/docker/use/managing.rst +++ b/docs/docker/use/managing.rst @@ -35,7 +35,7 @@ again. Under most circumstances, this is a matter of seconds. .. code-block:: bash - docker plugin upgrade --skip-remote-check --grant-all-permissions netapp:latest netapp/trident-plugin:21.07 + docker plugin upgrade --skip-remote-check --grant-all-permissions netapp:latest docker.io/netapp/trident-plugin:21.07 .. note:: diff --git a/docs/kubernetes/deploying/operator-deploy.rst b/docs/kubernetes/deploying/operator-deploy.rst index 90d5a6227..89ee72f04 100644 --- a/docs/kubernetes/deploying/operator-deploy.rst +++ b/docs/kubernetes/deploying/operator-deploy.rst @@ -226,7 +226,7 @@ installation in the ``trident`` namespace. Current Installation Params: IPv6: false Autosupport Hostname: - Autosupport Image: netapp/trident-autosupport:21.01 + Autosupport Image: docker.io/netapp/trident-autosupport:21.01 Autosupport Proxy: Autosupport Serial Number: Debug: true @@ -237,7 +237,7 @@ installation in the ``trident`` namespace. Kubelet Dir: /var/lib/kubelet Log Format: text Silence Autosupport: false - Trident Image: netapp/trident:21.07.0 + Trident Image: docker.io/netapp/trident:21.07.0 Message: Trident installed Namespace: trident Status: Installed @@ -265,11 +265,11 @@ useIPv6 Install Trident over IPv6 k8sTimeout Timeout for Kubernetes operations 30sec silenceAutosupport Don't send autosupport bundles to NetApp automatically 'false' enableNodePrep Manage worker node dependencies automatically (**BETA**) 'false' -autosupportImage The container image for Autosupport Telemetry "netapp/trident-autosupport:21.01.0" +autosupportImage The container image for Autosupport Telemetry "docker.io/netapp/trident-autosupport:21.01.0" autosupportProxy The address/port of a proxy for sending Autosupport Telemetry "http://proxy.example.com:8888" uninstall A flag used to uninstall Trident 'false' logFormat Trident logging format to be used [text,json] "text" -tridentImage Trident image to install "netapp/trident:21.07" +tridentImage Trident image to install "docker.io/netapp/trident:21.07" imageRegistry Path to internal registry, of the format ``[:port][/subpath]`` "k8s.gcr.io/sig-storage" kubeletDir Path to the kubelet directory on the host "/var/lib/kubelet" wipeout A list of resources to delete to perform a complete removal of Trident @@ -302,7 +302,7 @@ customize your Trident installation. Here's an example: spec: debug: true namespace: trident - tridentImage: netapp/trident:21.07.0 + tridentImage: docker.io/netapp/trident:21.07.0 imagePullSecrets: - thisisasecret diff --git a/docs/kubernetes/upgrades/downgrading.rst b/docs/kubernetes/upgrades/downgrading.rst index 6d0e367f9..b5b57e37f 100644 --- a/docs/kubernetes/upgrades/downgrading.rst +++ b/docs/kubernetes/upgrades/downgrading.rst @@ -94,8 +94,8 @@ If you are unsure as to how Trident is installed, here is a simple test to run: $ kubectl describe pod trident-csi-79df798bdc-2jzpq -n trident | grep "Image" -A 2 -B 2 | head -4 trident-main: Container ID: docker://e088b1ffc7017ddba8144d334cbc1eb646bf3491be031ef583a3f189ed965213 - Image: netapp/trident:21.07.0 - Image ID: docker-pullable://netapp/trident@sha256:28095a20d8cfffaaaaakkkkkeeeeeec4925ac5d652341b6eaa2ea9352f1e0 + Image: docker.io/netapp/trident:21.07.0 + Image ID: docker-pullable://docker.io/netapp/trident@sha256:28095a20d8cfffaaaaakkkkkeeeeeec4925ac5d652341b6eaa2ea9352f1e0 #Is the version of Trident being used >=21.01? If yes, check if a ``tridentorchestrator`` is present. #If yes, then you have installed Trident using the operator. diff --git a/docs/reference/tridentctl.rst b/docs/reference/tridentctl.rst index 87eab5e18..132a44db4 100644 --- a/docs/reference/tridentctl.rst +++ b/docs/reference/tridentctl.rst @@ -126,7 +126,7 @@ Install Trident tridentctl install [flags] Flags: - --autosupport-image string The container image for Autosupport Telemetry (default "netapp/trident-autosupport:20.07.0") + --autosupport-image string The container image for Autosupport Telemetry (default "docker.io/netapp/trident-autosupport:20.07.0") --autosupport-proxy string The address/port of a proxy for sending Autosupport Telemetry --csi Install CSI Trident (override for Kubernetes 1.13 only, requires feature gates). --enable-node-prep Attempt to install required packages on nodes. diff --git a/docs/support/requirements.rst b/docs/support/requirements.rst index 8b136f6bb..f4ca1f8b6 100644 --- a/docs/support/requirements.rst +++ b/docs/support/requirements.rst @@ -96,11 +96,11 @@ Trident: +------------------------+-------------------------------------------------------------+ | KUBERNETES VERSION | CONTAINER IMAGE | +========================+=============================================================+ -| v1.17.0 | netapp/trident:21.07.0 | +| v1.17.0 | docker.io/netapp/trident:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-operator:21.07.0 | +| | docker.io/netapp/trident-operator:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-autosupport:21.01 | +| | docker.io/netapp/trident-autosupport:21.01 | +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 | +------------------------+-------------------------------------------------------------+ @@ -112,11 +112,11 @@ Trident: +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 | +------------------------+-------------------------------------------------------------+ -| v1.18.0 | netapp/trident:21.07.0 | +| v1.18.0 | docker.io/netapp/trident:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-operator:21.07.0 | +| | docker.io/netapp/trident-operator:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-autosupport:21.01 | +| | docker.io/netapp/trident-autosupport:21.01 | +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 | +------------------------+-------------------------------------------------------------+ @@ -128,11 +128,11 @@ Trident: +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 | +------------------------+-------------------------------------------------------------+ -| v1.19.0 | netapp/trident:21.07.0 | +| v1.19.0 | docker.io/netapp/trident:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-operator:21.07.0 | +| | docker.io/netapp/trident-operator:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-autosupport:21.01 | +| | docker.io/netapp/trident-autosupport:21.01 | +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 | +------------------------+-------------------------------------------------------------+ @@ -144,11 +144,11 @@ Trident: +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 | +------------------------+-------------------------------------------------------------+ -| v1.20.0 | netapp/trident:21.07.0 | +| v1.20.0 | docker.io/netapp/trident:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-operator:21.07.0 | +| | docker.io/netapp/trident-operator:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-autosupport:21.01 | +| | docker.io/netapp/trident-autosupport:21.01 | +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 | +------------------------+-------------------------------------------------------------+ @@ -160,11 +160,11 @@ Trident: +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 | +------------------------+-------------------------------------------------------------+ -| v1.21.0 | netapp/trident:21.07.0 | +| v1.21.0 | docker.io/netapp/trident:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-operator:21.07.0 | +| | docker.io/netapp/trident-operator:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-autosupport:21.01 | +| | docker.io/netapp/trident-autosupport:21.01 | +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 | +------------------------+-------------------------------------------------------------+ @@ -176,11 +176,11 @@ Trident: +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 | +------------------------+-------------------------------------------------------------+ -| v1.22.0 | netapp/trident:21.07.0 | +| v1.22.0 | docker.io/netapp/trident:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-operator:21.07.0 | +| | docker.io/netapp/trident-operator:21.07.0 | +------------------------+-------------------------------------------------------------+ -| | netapp/trident-autosupport:21.01 | +| | docker.io/netapp/trident-autosupport:21.01 | +------------------------+-------------------------------------------------------------+ | | k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 | +------------------------+-------------------------------------------------------------+ diff --git a/helm/trident-operator/templates/_helpers.tpl b/helm/trident-operator/templates/_helpers.tpl index cadaea2ff..fe81e2963 100644 --- a/helm/trident-operator/templates/_helpers.tpl +++ b/helm/trident-operator/templates/_helpers.tpl @@ -71,7 +71,7 @@ Trident operator image {{- else if .Values.imageRegistry }} {{- .Values.imageRegistry }}/trident-operator:{{ .Values.operatorImageTag | default .Chart.AppVersion }} {{- else }} -{{- "" }}netapp/trident-operator:{{ .Values.operatorImageTag | default .Chart.AppVersion }} +{{- "" }}docker.io/netapp/trident-operator:{{ .Values.operatorImageTag | default .Chart.AppVersion }} {{- end }} {{- end }} @@ -116,7 +116,7 @@ Trident AutoSupport image {{- else if .Values.imageRegistry }} {{- .Values.imageRegistry }}/trident-autosupport:{{ .Values.tridentAutosupportImageTag | default .Chart.AppVersion | trunc 5}} {{- else }} -{{- "" }}netapp/trident-autosupport:{{ .Values.tridentAutosupportImageTag | default .Chart.AppVersion | trunc 5}} +{{- "" }}docker.io/netapp/trident-autosupport:{{ .Values.tridentAutosupportImageTag | default .Chart.AppVersion | trunc 5}} {{- end }} {{- end }} @@ -151,7 +151,7 @@ Trident image {{- else if .Values.imageRegistry }} {{- .Values.imageRegistry }}/trident:{{ .Values.tridentImageTag | default .Chart.AppVersion }} {{- else }} -{{- "" }}netapp/trident:{{ .Values.tridentImageTag | default .Chart.AppVersion }} +{{- "" }}docker.io/netapp/trident:{{ .Values.tridentImageTag | default .Chart.AppVersion }} {{- end }} {{- end }} diff --git a/operator/controllers/orchestrator/installer/config.go b/operator/controllers/orchestrator/installer/config.go index d838b56ce..9022f152e 100644 --- a/operator/controllers/orchestrator/installer/config.go +++ b/operator/controllers/orchestrator/installer/config.go @@ -9,7 +9,7 @@ import ( var ( DefaultTridentVersion = config.DefaultOrchestratorVersion - DefaultTridentRepo = "netapp/trident:" // Default repo from where to pull Trident Image + DefaultTridentRepo = "docker.io/netapp/trident:" // Default repo from where to pull Trident Image // TridentImage is the image that the operator installs by default TridentImage = DefaultTridentRepo + DefaultTridentVersion