From fe842507b8ab6c4320e4f910c3e15b03142c8699 Mon Sep 17 00:00:00 2001 From: killianmuldoon Date: Tue, 11 Oct 2022 14:50:06 +0100 Subject: [PATCH] Add Docker specific get kubeconfig to quickstart Signed-off-by: killianmuldoon --- docs/book/src/clusterctl/developers.md | 17 +++++++++++++---- docs/book/src/user/quick-start.md | 23 +++++++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/docs/book/src/clusterctl/developers.md b/docs/book/src/clusterctl/developers.md index ffc20f5b04b4..9dfacbe7c5db 100644 --- a/docs/book/src/clusterctl/developers.md +++ b/docs/book/src/clusterctl/developers.md @@ -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 diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index d845b4f80bbf..b8969a556e5f 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -1091,20 +1091,35 @@ The control plane won't be `Ready` until we install a CNI in the next step. -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 ``` -