You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!--Delete sections as needed -->
## Description
Kubernetes freshness. Only new new content is on Troubleshooting. Rest
is expanded slightly/presented better.
## Related issues or tickets
<!-- Related issues, pull requests, or Jira tickets -->
## Reviews
<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->
- [ ] Technical review
- [ ] Editorial review
- [ ] Product review
---------
Co-authored-by: Sarah Sanders <[email protected]>
Co-authored-by: David Karlsson <[email protected]>
Copy file name to clipboardExpand all lines: content/manuals/desktop/features/kubernetes.md
+61-31Lines changed: 61 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,44 +9,57 @@ aliases:
9
9
weight: 60
10
10
---
11
11
12
-
Docker Desktop includes a standalone Kubernetes server and client,
13
-
as well as Docker CLI integration that runs on your machine.
12
+
Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration, enabling local Kubernetes development and testing directly on your machine.
14
13
15
-
The Kubernetes server runs locally within your Docker instance, is not configurable, and is a single-node cluster. It runs within a Docker container on your local system, and
16
-
is only for local testing.
14
+
The Kubernetes server runs as a single-node cluster within a Docker container. This lightweight setup helps you explore Kubernetes features, test workloads, and work with container orchestration in parallel with other Docker functionalities.
17
15
18
-
Turning on Kubernetes allows you to deploy
19
-
your workloads in parallel, on Kubernetes, Swarm, and as standalone containers. Turning on or off the Kubernetes server does not affect your other
20
-
workloads.
16
+
Kubernetes on Docker Desktop runs alongside other workloads, including Swarm services and standalone containers.
17
+
18
+
## What happens when I enable Kubernetes in Docker Desktop?
19
+
20
+
When you enable Kubernetes in Docker Desktop, the following actions are triggered in the Docker Desktop backend and VM:
21
+
22
+
- Generation of certificates and cluster configuration
23
+
- Download and installation of Kubernetes internal components
24
+
- Cluster bootup
25
+
- Installation of additional controllers for networking and storage
26
+
27
+
Turning the Kubernetes server on or off in Docker Desktop does not affect your other workloads.
21
28
22
29
## Install and turn on Kubernetes
23
30
24
-
1.From the Docker Desktop Dashboard, select the**Settings**.
25
-
2. Select **Kubernetes**from the left sidebar.
26
-
3.Next to**Enable Kubernetes**, select the checkbox.
27
-
4. Select **Apply & Restart** to save the settings and then select **Install** to confirm. This instantiates images required to run the Kubernetes server as containers, and installs the `/usr/local/bin/kubectl`command on your machine.
31
+
1.Open the Docker Desktop Dashboard and navigate to**Settings**.
32
+
2. Select the **Kubernetes**tab.
33
+
3.Select the**Enable Kubernetes** checkbox.
34
+
4. Select **Apply & Restart** to save the settings and then select **Install** to confirm. This sets up the images required to run the Kubernetes server as containers, and installs the `kubectl` command-line tool on your system at `/usr/local/bin/kubectl`(Mac) or `C:\Program Files\Docker\Docker\Resources\bin\kubectl.exe` (Windows).
28
35
29
-
> [!IMPORTANT]
36
+
> [!NOTE]
30
37
>
31
-
> The `kubectl` binary is not automatically packaged with Docker Desktop for Linux. To install the kubectl command for Linux, see [Kubernetes documentation](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/). It should be installed at `/usr/local/bin/kubectl`.
38
+
> Docker Desktop for Linux does not include `kubectl` by default. You can install it separately by following the [Kubernetes installation guide](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/). Ensure the `kubectl` binary is installed at `/usr/local/bin/kubectl`.
32
39
33
-
By default, Kubernetes containers are hidden from commands like `docker ps`, because managing them manually is not supported. Most users do not need this option. To see these internal containers, select **Show system containers (advanced)**.
40
+
When Kubernetes is enabled, its status is displayed in the Docker Desktop Dashboard footer and the Docker menu.
34
41
35
-
When Kubernetes is turned on and running, an additional status bar in the Docker Desktop Dashboard footer and Docker menu displays.
42
+
You can check which version of Kubernetes you're on with:
36
43
37
-
> [!NOTE]
38
-
>
39
-
> Docker Desktop does not upgrade your Kubernetes cluster automatically after a new update. To upgrade your Kubernetes cluster to the latest version, select **Reset Kubernetes Cluster**.
44
+
```console
45
+
$ kubectl version
46
+
```
47
+
48
+
### Viewing system containers
49
+
50
+
By default, Kubernetes system containers are hidden. To inspect these containers, navigate to **Settings** > **Kubernetes** and then enable **Show system containers (advanced)**.
40
51
41
-
## Use the kubectl command
52
+
You can now view the running Kubernetes containers with `docker ps` or in the Docker Desktop Dashboard.
42
53
43
-
Kubernetes integration provides the Kubernetes CLI command
54
+
## Using the kubectl command
55
+
56
+
Kubernetes integration automatically installs the Kubernetes CLI command
44
57
at `/usr/local/bin/kubectl` on Mac and at `C:\Program Files\Docker\Docker\Resources\bin\kubectl.exe` on Windows. This location may not be in your shell's `PATH`
45
58
variable, so you may need to type the full path of the command or add it to
46
59
the `PATH`.
47
60
48
61
If you have already installed `kubectl` and it is
49
-
pointing to some other environment, such as `minikube` or a GKE cluster, ensure you change the context so that `kubectl` is pointing to `docker-desktop`:
62
+
pointing to some other environment, such as `minikube` or a Google Kubernetes Engine cluster, ensure you change the context so that `kubectl` is pointing to `docker-desktop`:
> Run the `kubectl` command in a CMD or PowerShell terminal, otherwise `kubectl config get-contexts` may return an empty result.
59
-
>
60
-
> If you are using a different terminal and this happens, you can try setting the `kubeconfig` environment variable to the location of the `.kube/config` file.
71
+
> If the `kubectl` config get-contexts command returns an empty result, try:
72
+
>
73
+
> - Running the command in the Command Prompt or PowerShell.
74
+
> - Setting the `KUBECONFIG` environment variable to point to your `.kube/config` file.
61
75
62
-
If you installed `kubectl` using Homebrew, or by some other method, and
Kubernetes clusters are not automatically upgraded with Docker Desktop updates. To upgrade the cluster, you must manually select **Reset Kubernetes Cluster** in settings.
95
+
96
+
## Troubleshooting
97
+
98
+
- If Kubernetes fails to start, make sure Docker Desktop is running with enough allocated resources. Check **Settings** > **Resources**.
99
+
- If the `kubectl` commands return errors, confirm the context is set to `docker-desktop`
100
+
```console
101
+
$ kubectl config use-context docker-desktop
102
+
```
103
+
You can then try checking the logs of the [Kubernetes system containers](#viewing-system-containers) if you have enabled that setting.
104
+
- If you're experiencing cluster issues after updating, reset your Kubernetes cluster. Resetting a Kubernetes cluster can help resolve issues by essentially reverting the cluster to a clean state, and clearing out misconfigurations, corrupted data, or stuck resources that may be causing problems. If the issue still persists, you may need to clean and purge data, and then restart Docker Desktop.
105
+
77
106
## Turn off and uninstall Kubernetes
78
107
79
108
To turn off Kubernetes in Docker Desktop:
109
+
80
110
1. From the Docker Desktop Dashboard, select the **Settings** icon.
81
-
2. Select **Kubernetes**from the left sidebar.
82
-
3.Next to**Enable Kubernetes**, clear the checkbox
83
-
4. Select **Apply & Restart** to save the settings.This stops and removes Kubernetes containers, and also removes the `/usr/local/bin/kubectl` command.
111
+
2. Select the **Kubernetes**tab.
112
+
3.Deselect the**Enable Kubernetes**checkbox.
113
+
4. Select **Apply & Restart** to save the settings.This stops and removes Kubernetes containers, and also removes the `/usr/local/bin/kubectl` command.
0 commit comments