Skip to content

Commit 84b1728

Browse files
authored
Merge pull request #7392 from killianmuldoon/docs/add-kind-kubeconfig-for-docker
📖 Add Docker specific get kubeconfig to quickstart
2 parents ea213ba + fe84250 commit 84b1728

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

docs/book/src/clusterctl/developers.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,27 @@ For example, assuming that on [docker hub][kind-docker-hub] there is no
175175
image for version `vX.Y.Z`, therefore creating a CAPD workload cluster with
176176
`--kubernetes-version=vX.Y.Z` will fail. See [issue 3795] for more details.
177177

178-
### Get the kubeconfig for the workload cluster
178+
### Get the kubeconfig for the workload cluster when using Docker Desktop
179179

180-
The command for getting the kubeconfig file for connecting to a workload cluster is the following:
180+
For Docker Desktop on macOS, Linux or Windows use kind to retrieve the kubeconfig.
181181

182+
```bash
183+
kind get kubeconfig --name capi-quickstart > capi-quickstart.kubeconfig
184+
````
185+
186+
Docker Engine for Linux works with the default clusterctl approach.
182187
```bash
183188
clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
184189
```
185190

186-
### Fix kubeconfig when using Docker Desktop
191+
### Fix kubeconfig when using Docker Desktop and clusterctl
192+
When retrieving the kubeconfig using `clusterctl` with Docker Desktop on macOS or Windows or Docker Desktop (Docker Engine works fine) on Linux, you'll need to take a few extra steps to get the kubeconfig for a workload cluster created with the Docker provider.
187193
188-
When using Docker Desktop on macOS or Docker Desktop (Docker Engine works fine) on Linux, you'll need to take a few extra steps to get the kubeconfig for a workload cluster created with the Docker provider.
194+
```bash
195+
clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
196+
```
189197
198+
To fix the kubeconfig run:
190199
```bash
191200
# Point the kubeconfig to the exposed port of the load balancer, rather than the inaccessible container IP.
192201
sed -i -e "s/server:.*/server: https:\/\/$(docker port capi-quickstart-lb 6443/tcp | sed "s/0.0.0.0/127.0.0.1/")/g" ./capi-quickstart.kubeconfig

docs/book/src/user/quick-start.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,20 +1091,35 @@ The control plane won't be `Ready` until we install a CNI in the next step.
10911091
10921092
</aside>
10931093
1094-
After the first control plane node is up and running, we can retrieve the [workload cluster] Kubeconfig:
1094+
After the first control plane node is up and running, we can retrieve the [workload cluster] Kubeconfig.
1095+
1096+
{{#tabs name:"tab-get-kubeconfig" tabs:"Default,Docker"}}
1097+
1098+
{{#/tab }}
1099+
{{#tab Default}}
10951100
10961101
```bash
10971102
clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
10981103
```
10991104
1100-
<aside class="note warning">
1105+
{{#/tab }}
11011106
1102-
<h1>Warning</h1>
1107+
{{#tab Docker}}
1108+
For Docker Desktop on macOS, Linux or Windows use kind to retrieve the kubeconfig. Docker Engine for Linux works with the default clusterctl approach.
11031109
1104-
If you're using Docker Desktop on macOS, or Docker Desktop (Docker Engine works fine) on Linux, you'll need to take a few extra steps to get the kubeconfig for a workload cluster created with the Docker provider. See [Additional Notes for the Docker provider](../clusterctl/developers.md#additional-notes-for-the-docker-provider).
1110+
```bash
1111+
kind get kubeconfig --name capi-quickstart > capi-quickstart.kubeconfig
1112+
```
1113+
1114+
<aside class="note warning">
1115+
1116+
Note: To use the default clusterctl method to retrieve kubeconfig for a workload cluster created with the Docker provider when using Docker Desktop see [Additional Notes for the Docker provider](../clusterctl/developers.md#additional-notes-for-the-docker-provider).
11051117
11061118
</aside>
11071119
1120+
{{#/tab }}
1121+
{{#/tabs }}
1122+
11081123
### Deploy a CNI solution
11091124
11101125
Calico is used here as an example.

0 commit comments

Comments
 (0)