Skip to content

Commit 6310219

Browse files
committed
Expand documentation on the KubernetesImagesRepository setting.
Provide our users more help on this setting. Place the info in the Kubernetes feature section, and link to it from the admin-settings description for KubernetesImagesRepository. Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
1 parent 7543797 commit 6310219

File tree

2 files changed

+101
-11
lines changed

2 files changed

+101
-11
lines changed

content/manuals/desktop/features/kubernetes.md

+98-8
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ The following table summarizes this comparison.
8181
| Works with containerd image store | Yes | Yes |
8282
| Works with Docker image store | Yes | No |
8383

84-
### Additional settings
85-
86-
#### Viewing system containers
87-
88-
By default, Kubernetes system containers are hidden. To inspect these containers, enable **Show system containers (advanced)**.
89-
90-
You can now view the running Kubernetes containers with `docker ps` or in the Docker Desktop Dashboard.
91-
9284
## Using the kubectl command
9385

9486
Kubernetes integration automatically installs the Kubernetes CLI command
@@ -131,6 +123,104 @@ For more information about `kubectl`, see the
131123

132124
Kubernetes clusters are not automatically upgraded with Docker Desktop updates. To upgrade the cluster, you must manually select **Reset Kubernetes Cluster** in settings.
133125

126+
## Additional settings
127+
128+
### Viewing system containers
129+
130+
By default, Kubernetes system containers are hidden. To inspect these containers, enable **Show system containers (advanced)**.
131+
132+
You can now view the running Kubernetes containers with `docker ps` or in the Docker Desktop Dashboard.
133+
134+
### Configuring a custom image registry for Kubernetes control plane images
135+
136+
Docker Desktop uses containers to run the Kubernetes control plane. By default, Docker Desktop pulls
137+
the associated container images from DockerHub. The images pulled depend on the [cluster provisioning mode](#cluster-provisioning-method).
138+
139+
For example, in `kind` mode it requires the following images:
140+
141+
```console
142+
docker.io/kindest/node:<tag>
143+
docker.io/docker/desktop-cloud-provider-kind:<tag>
144+
docker.io/docker/desktop-containerd-registry-mirror:<tag>
145+
```
146+
147+
In `kubeadm` mode it requires the following images:
148+
149+
```console
150+
docker.io/registry.k8s.io/kube-controller-manager:<tag>
151+
docker.io/registry.k8s.io/kube-apiserver:<tag>
152+
docker.io/registry.k8s.io/kube-scheduler:<tag>
153+
docker.io/registry.k8s.io/kube-proxy
154+
docker.io/registry.k8s.io/etcd:<tag>
155+
docker.io/registry.k8s.io/pause:<tag>
156+
docker.io/registry.k8s.io/coredns/coredns:<tag>
157+
docker.io/docker/desktop-storage-provisioner:<tag>
158+
docker.io/docker/desktop-vpnkit-controller:<tag>
159+
docker.io/docker/desktop-kubernetes:<tag>
160+
```
161+
162+
The image tags are automatically selected by Docker Desktop based on several
163+
factors, including the version of Kubernetes being used. The tags vary for each image.
164+
165+
To accommodate scenarios where access to DockerHub may not be allowed, admins can
166+
configure Docker Desktop to pull the above listed images from a different registry (e.g., a mirror)
167+
using the [KubernetesImagesRepository](../../security/for-admins/hardened-desktop/settings-management/configure-json-file.md#kubernetes) setting as follows.
168+
169+
An image name can be broken into `[registry[:port]/][namespace/]repository[:tag]` components.
170+
The `KubernetesImagesRepository` setting allows users to override the `[registry[:port]/][namespace/]`
171+
portion of the image's name.
172+
173+
For example, if Docker Desktop Kubernetes is configured in `kind` mode and
174+
`KubernetesImagesRepository` is set to `my-registry:5000/kind-images`, then
175+
Docker Desktop will pull the images from:
176+
177+
```console
178+
my-registry:5000/kind-images/node:<tag>
179+
my-registry:5000/kind-images/desktop-cloud-provider-kind:<tag>
180+
my-registry:5000/kind-images/desktop-containerd-registry-mirror:<tag>
181+
```
182+
183+
These images should be cloned / mirrored from their respective images in DockerHub. The tags must
184+
also match what Docker Desktop expects.
185+
186+
The recommended approach to set this up is the following:
187+
188+
1) Start Docker Desktop
189+
190+
2) In Settings -> Kubernetes, enable the "Show system containers" setting.
191+
192+
3) In Settings -> Kubernetes, start Kubernetes using the desired cluster provisioning method (`kubeadm` or `kind`).
193+
194+
4) Wait for Kubernetes to start.
195+
196+
5) Use `docker ps` to view the container images used by Docker Desktop for the Kubernetes control plane.
197+
198+
6) Clone or mirror those images (with matching tags) to your custom registry.
199+
200+
7) Stop the Kubernetes cluster.
201+
202+
8) Configure the `KubernetesImagesRepository` setting to point to your custom registry.
203+
204+
9) Restart Docker Desktop.
205+
206+
10) Verify that the Kubernetes cluster is using the custom registry images (`docker ps`).
207+
208+
> [!NOTE]
209+
>
210+
> The `KubernetesImagesRepository` setting only applies to control plane images used by Docker Desktop
211+
> to set up the Kubernetes cluster. It has no effect on other Kubernetes pods.
212+
213+
> [!NOTE]
214+
>
215+
> When using `KubernetesImagesRepository` and [Enhanced Container Isolation (ECI)](../../security/for-admins/hardened-desktop/enhanced-container-isolation/_index.md)
216+
> is enabled, add the following images to the [ECI Docker socket mount image list](../../security/for-admins/hardened-desktop/settings-management/configure-json-file.md#enhanced-container-isolation):
217+
>
218+
> * [imagesRepositoryPath]/desktop-cloud-provider-kind:*
219+
> * [imagesRepositoryPath]/desktop-containerd-registry-mirror:*
220+
>
221+
> These containers mount the Docker socket, so you must add the images to the ECI images list. If not,
222+
> ECI will block the mount and Kubernetes won't start.
223+
134224
## Troubleshooting
135225

136226
- If Kubernetes fails to start, make sure Docker Desktop is running with enough allocated resources. Check **Settings** > **Resources**.

content/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ The following `admin-settings.json` code and table provides an example of the re
264264

265265
|Parameter|OS|Description|Version|
266266
|:-------------------------------|---|:-------------------------------|---|
267-
|`kubernetes`| | If `enabled` is set to true, a Kubernetes single-node cluster is started when Docker Desktop starts. If `showSystemContainers` is set to true, Kubernetes containers are displayed in the Docker Desktop Dashboard and when you run `docker ps`. `imagesRepository` lets you specify which repository Docker Desktop pulls the Kubernetes images from. For example, `"imagesRepository": "registry-1.docker.io/docker"`. | |
267+
|`kubernetes`| | If `enabled` is set to true, a Kubernetes single-node cluster is started when Docker Desktop starts. If `showSystemContainers` is set to true, Kubernetes containers are displayed in the Docker Desktop Dashboard and when you run `docker ps`. The [imagesRepository](../../../../desktop/features/kubernetes.md#configuring-a-custom-image-registry-for-kubernetes-control-plane-images) setting lets you specify which repository Docker Desktop pulls control-plane Kubernetes images from. | |
268268

269269
> [!NOTE]
270270
>
271271
> When using the `imagesRepository` setting and Enhanced Container Isolation (ECI), add the following images to the [ECI Docker socket mount image list](#enhanced-container-isolation):
272272
>
273-
> `<custom-image-repo>/desktop-cloud-provider-kind:*`
274-
> `<custom-image-repo>/desktop-containerd-registry-mirror:*`
273+
> * [imagesRepositoryPath]/desktop-cloud-provider-kind:*
274+
> * [imagesRepositoryPath]/desktop-containerd-registry-mirror:*
275275
>
276276
> These containers mount the Docker socket, so you must add the images to the ECI images list. If not, ECI will block the mount and Kubernetes won't start.
277277

0 commit comments

Comments
 (0)