diff --git a/docs/diagrams/bootstrap-token-authentication-for-byohost.png b/docs/diagrams/bootstrap-token-authentication-for-byohost.png index 36275b7fb..4636c81ea 100644 Binary files a/docs/diagrams/bootstrap-token-authentication-for-byohost.png and b/docs/diagrams/bootstrap-token-authentication-for-byohost.png differ diff --git a/docs/getting_started.md b/docs/getting_started.md index 34b1c7f8f..28c4c72c5 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -81,37 +81,6 @@ done ## Register BYOH host to management cluster - -### Generating the Bootstrap Kubeconfig file -Get the APIServer and Certificate Authority Data info - -```shell -APISERVER=$(kubectl config view -ojsonpath='{.clusters[0].cluster.server}') -CA_CERT=$(kubectl config view --flatten -ojsonpath='{.clusters[0].cluster.certificate-authority-data}') -``` - -Create a BootstrapKubeconfig CR as follows -```shell -cat < byoh-agent.log 2>&1 & +./byoh-hostagent-linux-amd64 --kubeconfig management-cluster.conf > byoh-agent.log 2>&1 & ``` --- If you are trying this using the docker containers we started above, then we would first need to prep the kubeconfig to be used from the docker containers. By default, the kubeconfig states that the server is at `127.0.0.1`. We need to swap this out with the kind container IP. ```shell -cp ~/bootstrap-kubeconfig ~/bootstrap-kubeconfig.conf +cp ~/.kube/config ~/.kube/management-cluster.conf export KIND_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kind-control-plane) -sed -i 's/ server\:.*/ server\: https\:\/\/'"$KIND_IP"'\:6443/g' ~/bootstrap-kubeconfig.conf +sed -i 's/ server\:.*/ server\: https\:\/\/'"$KIND_IP"'\:6443/g' ~/.kube/management-cluster.conf ``` Assuming you have downloaded the `byoh-hostagent-linux-amd64` into your working directory, you can use the following script to start the agent on the containers. @@ -160,7 +129,7 @@ do echo "Copy agent binary to host $i" docker cp byoh-hostagent-linux-amd64 host$i:/byoh-hostagent echo "Copy kubeconfig to host $i" -docker cp ~/bootstrap-kubeconfig.conf host$i:/bootstrap-kubeconfig.conf +docker cp ~/.kube/management-cluster.conf host$i:/management-cluster.conf done ``` @@ -170,11 +139,11 @@ Start the host agent on each of the hosts and keep it running. ```shell export HOST_NAME=host1 -docker exec -it $HOST_NAME sh -c "chmod +x byoh-hostagent && ./byoh-hostagent --bootstrap-kubeconfig bootstrap-kubeconfig.conf" +docker exec -it $HOST_NAME sh -c "chmod +x byoh-hostagent && ./byoh-hostagent --kubeconfig management-cluster.conf" # do the same for host2 in a separate tab export HOST_NAME=host2 -docker exec -it $HOST_NAME sh -c "chmod +x byoh-hostagent && ./byoh-hostagent --bootstrap-kubeconfig bootstrap-kubeconfig.conf" +docker exec -it $HOST_NAME sh -c "chmod +x byoh-hostagent && ./byoh-hostagent --kubeconfig management-cluster.conf" ``` --- diff --git a/docs/local_dev.md b/docs/local_dev.md index b94d8d076..d2cc2d36c 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -78,44 +78,13 @@ Wait for all the resources to come up, status can be viewed in Tilt UI. Now that you have a management cluster with Cluster API and BYOHost provider installed, we can start to create a workload cluster. -### Generating the Bootstrap Kubeconfig file -Get the APIServer and Certificate Authority Data info - -```shell -APISERVER=$(kubectl config view -ojsonpath='{.clusters[0].cluster.server}') -CA_CERT=$(kubectl config view --flatten -ojsonpath='{.clusters[0].cluster.certificate-authority-data}') -``` - -Create a BootstrapKubeconfig CR as follows -```shell -cat <