Skip to content

Commit

Permalink
Add Docker specific get kubeconfig to quickstart
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <[email protected]>
  • Loading branch information
killianmuldoon committed Oct 12, 2022
1 parent 9277eb9 commit fe84250
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
17 changes: 13 additions & 4 deletions docs/book/src/clusterctl/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,27 @@ For example, assuming that on [docker hub][kind-docker-hub] there is no
image for version `vX.Y.Z`, therefore creating a CAPD workload cluster with
`--kubernetes-version=vX.Y.Z` will fail. See [issue 3795] for more details.

### Get the kubeconfig for the workload cluster
### Get the kubeconfig for the workload cluster when using Docker Desktop

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

```bash
kind get kubeconfig --name capi-quickstart > capi-quickstart.kubeconfig
````

Docker Engine for Linux works with the default clusterctl approach.
```bash
clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
```

### Fix kubeconfig when using Docker Desktop
### Fix kubeconfig when using Docker Desktop and clusterctl
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.
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.
```bash
clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
```
To fix the kubeconfig run:
```bash
# Point the kubeconfig to the exposed port of the load balancer, rather than the inaccessible container IP.
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
Expand Down
23 changes: 19 additions & 4 deletions docs/book/src/user/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -1091,20 +1091,35 @@ The control plane won't be `Ready` until we install a CNI in the next step.
</aside>
After the first control plane node is up and running, we can retrieve the [workload cluster] Kubeconfig:
After the first control plane node is up and running, we can retrieve the [workload cluster] Kubeconfig.
{{#tabs name:"tab-get-kubeconfig" tabs:"Default,Docker"}}
{{#/tab }}
{{#tab Default}}
```bash
clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
```
<aside class="note warning">
{{#/tab }}
<h1>Warning</h1>
{{#tab Docker}}
For Docker Desktop on macOS, Linux or Windows use kind to retrieve the kubeconfig. Docker Engine for Linux works with the default clusterctl approach.
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).
```bash
kind get kubeconfig --name capi-quickstart > capi-quickstart.kubeconfig
```
<aside class="note warning">
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).
</aside>
{{#/tab }}
{{#/tabs }}
### Deploy a CNI solution
Calico is used here as an example.
Expand Down

0 comments on commit fe84250

Please sign in to comment.