Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mondragonfx committed Jul 30, 2024
1 parent 2face5e commit 2235203
Showing 1 changed file with 48 additions and 60 deletions.
108 changes: 48 additions & 60 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,21 @@ Create the workload cluster on the management cluster:
---
clusterctl to generate the cluster definition
```
clusterctl generate cluster capi-test-cluster --from templates/cluster-template.yaml > cluster.yaml
clusterctl generate cluster capvultr-quickstart --from templates/cluster-template.yaml > cluster.yaml
```

Apply the template

```bash
$ kubectl apply -f cluster.yaml

cluster.cluster.x-k8s.io/capi-test-cluster created
vultrcluster.infrastructure.cluster.x-k8s.io/capi-test-cluster created
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capi-test-cluster-control-plane created
vultrmachinetemplate.infrastructure.cluster.x-k8s.io/capi-test-cluster-control-plane created
machinedeployment.cluster.x-k8s.io/capi-test-cluster-md-0 created
vultrmachinetemplate.infrastructure.cluster.x-k8s.io/capi-test-cluster-md-0 created
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/capi-test-cluster-md-0 created
cluster.cluster.x-k8s.io/capvultr-quickstart created
vultrcluster.infrastructure.cluster.x-k8s.io/capvultr-quickstart created
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capvultr-quickstart-control-plane created
vultrmachinetemplate.infrastructure.cluster.x-k8s.io/capvultr-quickstart-control-plane created
machinedeployment.cluster.x-k8s.io/capvultr-quickstart-md-0 created
vultrmachinetemplate.infrastructure.cluster.x-k8s.io/capvultr-quickstart-md-0 created
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/capvultr-quickstart-md-0 created

```

Expand All @@ -142,68 +144,54 @@ To verify that the first control plane is up, use:
$ kubectl get kubeadmcontrolplane

NAME CLUSTER INITIALIZED API SERVER AVAILABLE REPLICAS READY UPDATED UNAVAILABLE AGE VERSION
capi-test-cluster-control-plane capi-test-cluster true 1 1 1 20m v1.28.9
capvultr-quickstart-control-plane capvultr-quickstart true 1 1 1 20m v1.28.9

```

After the first control plane node has the `initialized` status, you can retrieve the workload cluster's Kubeconfig:

```bash
$ clusterctl get kubeconfig capi-test-cluster > capvultr-cluster.kubeconfig
$ clusterctl get kubeconfig capvultr-quickstart > capvultr-quickstart.kubeconfig
```

You can verify what kubernetes nodes exist in the workload cluster by using:

```bash
$ KUBECONFIG=capvultr-cluster.kubeconfig kubectl get node
$ KUBECONFIG=capvultr-quickstart.kubeconfig kubectl get node
NAME STATUS ROLES AGE VERSION
capi-test-cluster-control-plane-jsvrz NotReady control-plane 20m v1.28.9
capi-test-cluster-md-0-b54j9-2szdn NotReady <none> 14m v1.28.9
capi-test-cluster-md-0-b54j9-vb5tz NotReady <none> 14m v1.28.9
capvultr-quickstart-control-plane-jsvrz NotReady control-plane 20m v1.28.9
capvultr-quickstart-md-0-b54j9-2szdn NotReady <none> 14m v1.28.9
capvultr-quickstart-md-0-b54j9-vb5tz NotReady <none> 14m v1.28.9
```

### Deploy CNI
Cilium is used here as an example.


```bash
Cilium is used here as an example but you can bring your own CNI.

# SSH into the newly created controlplane on your Vultr Account and run the following
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
CLI_ARCH=amd64
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/#cilium-quick-installation


```
Install Cilium
```
cilium install --version 1.15.7
```

### Deploy Vultr CCM and CSI

```bash
# Create Vultr secret
$ KUBECONFIG=capvultr-cluster.kubeconfig kubectl create secret generic vultr-ccm --namespace kube-system --from-literal api-key=$VULTR_API_KEY
$ KUBECONFIG=capvultr-quickstart.kubeconfig kubectl create secret generic vultr-ccm --namespace kube-system --from-literal api-key=$VULTR_API_KEY

# Deploy Vultr Cloud Controller Manager
$ KUBECONFIG=capvultr-cluster.kubeconfig kubectl apply -f https://raw.githubusercontent.com/vultr/vultr-cloud-controller-manager/master/docs/releases/latest.yml
$ KUBECONFIG=capvultr-quickstart.kubeconfig kubectl apply -f https://raw.githubusercontent.com/vultr/vultr-cloud-controller-manager/master/docs/releases/latest.yml

```

After the [CNI](https://github.com/containernetworking/cni) and the [CCM](https://github.com/vultr/vultr-cloud-controller-manager) have deployed your workload cluster nodes should be in the `ready` state. You can verify this by using:

```bash
$ KUBECONFIG=capvultr-cluster.kubeconfig kubectl get node
$ KUBECONFIG=capvultr-quickstart.kubeconfig kubectl get node

NAME STATUS ROLES AGE VERSION
capi-test-cluster-control-plane-jsvrz Ready control-plane 51m v1.28.9
capi-test-cluster-md-0-b54j9-cw5jh Ready <none> 106s v1.28.9
capi-test-cluster-md-0-b54j9-nvv2c Ready <none> 8m17s v1.28.9
capvultr-quickstart-control-plane-jsvrz Ready control-plane 51m v1.28.9
capvultr-quickstart-md-0-b54j9-cw5jh Ready <none> 106s v1.28.9
capvultr-quickstart-md-0-b54j9-nvv2c Ready <none> 8m17s v1.28.9

```

Expand All @@ -213,50 +201,50 @@ On the Mangement Cluster you should see the following:
$ k get cluster-api
[0/1144]
NAME CLUSTER AGE
kubeadmconfig.bootstrap.cluster.x-k8s.io/capi-test-cluster-control-plane-jsvrz capi-test-cluster 56m
kubeadmconfig.bootstrap.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9-cw5jh capi-test-cluster 6m38s
kubeadmconfig.bootstrap.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9-nvv2c capi-test-cluster 13m
kubeadmconfig.bootstrap.cluster.x-k8s.io/capvultr-quickstart-control-plane-jsvrz capvultr-quickstart 56m
kubeadmconfig.bootstrap.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9-cw5jh capvultr-quickstart 6m38s
kubeadmconfig.bootstrap.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9-nvv2c capvultr-quickstart 13m
NAME AGE
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/capi-test-cluster-md-0 59m
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/capvultr-quickstart-md-0 59m
NAME CLUSTERCLASS PHASE AGE VERSION
cluster.cluster.x-k8s.io/capi-test-cluster Provisioned 59m
cluster.cluster.x-k8s.io/capvultr-quickstart Provisioned 59m
NAME CLUSTER REPLICAS READY UPDATED UNAVAILABLE PHASE AGE VERSION
machinedeployment.cluster.x-k8s.io/capi-test-cluster-md-0 capi-test-cluster 2 2 2 0 Running 59m v1.28.9
machinedeployment.cluster.x-k8s.io/capvultr-quickstart-md-0 capvultr-quickstart 2 2 2 0 Running 59m v1.28.9
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
machine.cluster.x-k8s.io/capi-test-cluster-control-plane-jsvrz capi-test-cluster capi-test-cluster-control-plane-jsvrz vultr://a657b222-4215-498a-9c7a-6886c0e1c397 Running 56m v1.28.9
machine.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9-cw5jh capi-test-cluster capi-test-cluster-md-0-b54j9-cw5jh vultr://4c6c4b0b-9801-4b8f-8de5-e37959f33aba Running 6m38s v1.28.9
machine.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9-nvv2c capi-test-cluster capi-test-cluster-md-0-b54j9-nvv2c vultr://ccec9632-b7e3-482b-bfa6-3ba59a2e39d0 Running 13m v1.28.9
machine.cluster.x-k8s.io/capvultr-quickstart-control-plane-jsvrz capvultr-quickstart capvultr-quickstart-control-plane-jsvrz vultr://a657b222-4215-498a-9c7a-6886c0e1c397 Running 56m v1.28.9
machine.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9-cw5jh capvultr-quickstart capvultr-quickstart-md-0-b54j9-cw5jh vultr://4c6c4b0b-9801-4b8f-8de5-e37959f33aba Running 6m38s v1.28.9
machine.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9-nvv2c capvultr-quickstart capvultr-quickstart-md-0-b54j9-nvv2c vultr://ccec9632-b7e3-482b-bfa6-3ba59a2e39d0 Running 13m v1.28.9
NAME CLUSTER REPLICAS READY AVAILABLE AGE VERSION
machineset.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9 capi-test-cluster 2 2 2 59m v1.28.9
machineset.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9 capvultr-quickstart 2 2 2 59m v1.28.9
NAME CLUSTER INITIALIZED API SERVER AVAILABLE REPLICAS READY UPDATED UNAVAILABLE AGE VERSION
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capi-test-cluster-control-plane capi-test-cluster true true 1 1 1 0 59m v1.28.9
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capvultr-quickstart-control-plane capvultr-quickstart true true 1 1 1 0 59m v1.28.9
NAME CLUSTER READY
vultrcluster.infrastructure.cluster.x-k8s.io/capi-test-cluster capi-test-cluster true
vultrcluster.infrastructure.cluster.x-k8s.io/capvultr-quickstart capvultr-quickstart true
NAME CLUSTER STATE READY INSTANCEID MACHINE
vultrmachine.infrastructure.cluster.x-k8s.io/capi-test-cluster-control-plane-jsvrz capi-test-cluster active true vultr://a657b222-4215-498a-9c7a-6886c0e1c397 capi-test-cluster-control-plane-jsvrz
vultrmachine.infrastructure.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9-cw5jh capi-test-cluster active true vultr://4c6c4b0b-9801-4b8f-8de5-e37959f33aba capi-test-cluster-md-0-b54j9-cw5jh
vultrmachine.infrastructure.cluster.x-k8s.io/capi-test-cluster-md-0-b54j9-nvv2c capi-test-cluster active true vultr://ccec9632-b7e3-482b-bfa6-3ba59a2e39d0 capi-test-cluster-md-0-b54j9-nvv2c
vultrmachine.infrastructure.cluster.x-k8s.io/capvultr-quickstart-control-plane-jsvrz capvultr-quickstart active true vultr://a657b222-4215-498a-9c7a-6886c0e1c397 capvultr-quickstart-control-plane-jsvrz
vultrmachine.infrastructure.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9-cw5jh capvultr-quickstart active true vultr://4c6c4b0b-9801-4b8f-8de5-e37959f33aba capvultr-quickstart-md-0-b54j9-cw5jh
vultrmachine.infrastructure.cluster.x-k8s.io/capvultr-quickstart-md-0-b54j9-nvv2c capvultr-quickstart active true vultr://ccec9632-b7e3-482b-bfa6-3ba59a2e39d0 capvultr-quickstart-md-0-b54j9-nvv2c
```

```
clusterctl describe cluster capi-test-cluster
clusterctl describe cluster capvultr-quickstart
NAME READY SEVERITY REASON SINCE MESSAGE
Cluster/capi-test-cluster True 53m
├─ClusterInfrastructure - VultrCluster/capi-test-cluster
├─ControlPlane - KubeadmControlPlane/capi-test-cluster-control-plane True 53m
│ └─Machine/capi-test-cluster-control-plane-jsvrz True 59m
│ └─MachineInfrastructure - VultrMachine/capi-test-cluster-control-plane-jsvrz
Cluster/capvultr-quickstart True 53m
├─ClusterInfrastructure - VultrCluster/capvultr-quickstart
├─ControlPlane - KubeadmControlPlane/capvultr-quickstart-control-plane True 53m
│ └─Machine/capvultr-quickstart-control-plane-jsvrz True 59m
│ └─MachineInfrastructure - VultrMachine/capvultr-quickstart-control-plane-jsvrz
└─Workers
└─MachineDeployment/capi-test-cluster-md-0 True 3m51s
└─2 Machines... True 16m See capi-test-cluster-md-0-b54j9-cw5jh, capi-test-cluster-md-0-b54j9-nvv2c
└─MachineDeployment/capvultr-quickstart-md-0 True 3m51s
└─2 Machines... True 16m See capvultr-quickstart-md-0-b54j9-cw5jh, capvultr-quickstart-md-0-b54j9-nvv2c
```


Expand All @@ -265,7 +253,7 @@ Cluster/capi-test-cluster
You can delete the workload cluster from the management cluster using:

```bash
$ kubectl delete cluster capi-test-cluster
$ kubectl delete cluster capvultr-quickstart
```

<!-- References -->
Expand Down

0 comments on commit 2235203

Please sign in to comment.