Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vmware-tanzu/cluster-api-provider-bringyourownhost
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8c8c03ef13c9517ea0c70c208454f70b95edb861
Choose a base ref
..
head repository: vmware-tanzu/cluster-api-provider-bringyourownhost
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 006adc91d4e959a658fe9fdccdeee89e45361f3c
Choose a head ref
Showing with 43 additions and 17 deletions.
  1. +43 −17 docs/getting_started.md
60 changes: 43 additions & 17 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -16,20 +16,20 @@ Kubernetes cluster will be transformed into a [management cluster](https://clust

1. **Existing Management Cluster**

For production use-cases a "real" Kubernetes cluster should be used with appropriate backup and DR policies and procedures in place. The Kubernetes cluster must be at least v1.19.1.
For production use-cases a "real" Kubernetes cluster should be used with appropriate backup and DR policies and procedures in place. The Kubernetes cluster must be at least v1.19.1.

```bash
export KUBECONFIG=<...>
```
```bash
export KUBECONFIG=<...>
```
**OR**

2. **Kind**

If you are testing locally, you can use [Kind][kind] to create a cluster with the following command:
If you are testing locally, you can use [Kind][kind] to create a cluster with the following command:

```shell
kind create cluster
```
```shell
kind create cluster
```

---
[kind] is not designed for production use.
@@ -52,7 +52,11 @@ providers:
type: InfrastructureProvider
```

running `clusterctl config repositories`.
running

```shell
clusterctl config repositories
```

You should be able to see the new `BYOH` provider there.
```shell
@@ -95,10 +99,10 @@ do
done
```

### Register BYOH host to management cluster
## Register BYOH host to management cluster

---
#### VM Prerequisites
### VM Prerequisites
- The following packages must be pre-installed on the VMs
- socat
- ebtables
@@ -126,7 +130,7 @@ If you are trying this on your own hosts, then for each host
2. Copy the management cluster `kubeconfig` file as `management.conf`
3. Start the agent
```shell
./byoh-hostagent-linux-amd64 -kubeconfig management.conf > byoh-agent.log 2>&1 &
./byoh-hostagent-linux-amd64 -kubeconfig management-cluster.conf > byoh-agent.log 2>&1 &
```

---
@@ -166,7 +170,7 @@ You should be able to view your registered hosts using
kubectl get byohosts
```

### Create workload cluster
## Create workload cluster
Running the following command(on the host where you execute `clusterctl` in previous steps)

**NOTE:** The `CONTROL_PLANE_ENDPOINT_IP` is an IP that must be an IP on the same subnet as the control plane machines, it should be also an IP that is not part of your DHCP range.
@@ -181,8 +185,29 @@ Randomly assign any free IP within the network subnet to the `CONTROL_PLANE_ENDP
```shell
docker network inspect kind | jq -r 'map(.Containers[].IPv4Address) []'
```
Create the workload cluster
### Create the workload cluster
Generate the cluster.yaml for workload cluster
- for vms as byohosts
```shell
CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 clusterctl generate cluster byoh-cluster \
--infrastructure byoh \
--kubernetes-version v1.22.3 \
--control-plane-machine-count 1 \
--worker-machine-count 1 > cluster.yaml
```
- for docker hosts use the --flavor argument
```shell
CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 clusterctl generate cluster byoh-cluster \
--infrastructure byoh \
--kubernetes-version v1.22.3 \
--control-plane-machine-count 1 \
--worker-machine-count 1 \
--flavor docker > cluster.yaml
```
Inspect and make any changes
```shell
# for vms as byohosts
$ BUNDLE_LOOKUP_TAG=v1.23.5 CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 clusterctl generate cluster byoh-cluster \
@@ -202,8 +227,9 @@ $ BUNDLE_LOOKUP_TAG=v1.23.5 CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 clusterctl gen
# Inspect and make any changes
$ vi cluster.yaml
# Create the workload cluster in the current namespace on the management cluster
$ kubectl apply -f cluster.yaml
Create the workload cluster in the current namespace on the management cluster
```shell
kubectl apply -f cluster.yaml
```
## Accessing the workload cluster
@@ -212,7 +238,7 @@ The `kubeconfig` for the workload cluster will be stored in a secret, which can
be retrieved using:
``` shell
$ kubectl get secret/byoh-cluster-kubeconfig -o json \
kubectl get secret/byoh-cluster-kubeconfig -o json \
| jq -r .data.value \
| base64 --decode \
> ./byoh-cluster.kubeconfig