Skip to content

Commit

Permalink
Extend vSphere guide
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rj1k authored and randybias committed Jan 16, 2025
1 parent e3687fd commit ec57200
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
38 changes: 35 additions & 3 deletions docs/clustertemplates/vsphere/template-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ for successful cluster creation.

| Parameter | Example | Description |
|---------------------------------------|---------------------------------------|-----------------------------------------------------------------|
| `.spec.config.vsphere.server` | `vcenter.example.com` | Address of the vSphere server |
| `.spec.config.vsphere.thumbprint` | `"00:00:00"` | Certificate thumbprint |
| `.spec.config.vsphere.server` | `vcenter.example.com` | Address of the vSphere instance |
| `.spec.config.vsphere.thumbprint` | `"00:00:00:..."` | Certificate thumbprint |
| `.spec.config.vsphere.datacenter` | `DC` | Datacenter name |
| `.spec.config.vsphere.datastore` | `/DC/datastore/DS` | Datastore path |
| `.spec.config.vsphere.resourcePool` | `/DC/host/vCluster/Resources/ResPool` | Resource pool path |
| `.spec.config.vsphere.folder` | `/DC/vm/example` | vSphere folder path |
| `.spec.config.vsphere.folder` | `/DC/vm/example` | Folder path |
| `.spec.config.controlPlane.network` | `/DC/network/vm_net` | Network path for `controlPlane` |
| `.spec.config.worker.network` | `/DC/network/vm_net` | Network path for `worker` |
| `.spec.config.*.ssh.publicKey` | `"ssh-ed25519 AAAA..."` | SSH public key in `authorized_keys` format |
| `.spec.config.*.vmTemplate` | `/DC/vm/templates/ubuntu` | VM template image path |
| `.spec.config.controlPlaneEndpointIP` | `172.16.0.10` | `kube-vip` vIP which will be created for control plane endpoint |

To obtain vSphere certificate thumbprint you can use the following command:
Expand All @@ -26,6 +30,34 @@ To obtain vSphere certificate thumbprint you can use the following command:
curl -sw %{certs} https://vcenter.example.com | openssl x509 -sha256 -fingerprint -noout | awk -F '=' '{print $2}'
```

[`govc`](https://github.com/vmware/govmomi/blob/main/govc/README.md), a vSphere CLI, can also help to discover proper values for some of the parameters:

```bash
# vsphere.datacenter
govc ls

# vsphere.datastore
govc ls /*/datastore/*

# vsphere.resourcePool
govc ls /*/host/*/Resources/*

# vsphere.folder
govc ls -l /*/vm/**

# controlPlane.network, worker.network
govc ls /*/network/*

# *.vmTemplate
govc vm.info -t '*'
```

> NOTE:
> Follow official `govc` installation instructions from [here](https://github.com/vmware/govmomi/blob/main/govc/README.md#installation).
> `govc` usage guide is [here](https://github.com/vmware/govmomi/blob/main/govc/README.md#usage)
> Minimal `govc` configuration requires setting: `GOVC_URL`, `GOVC_USERNAME`, `GOVC_PASSWORD` environment variables.

## Example of ClusterDeployment CR

With all above parameters provided your `ClusterDeployment` can look like this:
Expand Down
9 changes: 8 additions & 1 deletion docs/quick-start/vsphere.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
name: my-vsphere-clusterdeployment1
namespace: kcm-system
spec:
template: vsphere-standalone-cp-0-0-3
template: vsphere-standalone-cp-0-0-5
credential: vsphere-cluster-identity-cred
config:
vsphere:
Expand All @@ -176,6 +176,7 @@ spec:
```

> NOTE:
> To see available versions for `vSphere` template run `kubectl get clustertemplate -n kcm-system`.
>
> For more information about the config options, see the
> [vSphere Template Parameters](../clustertemplates/vsphere/template-parameters.md).
Expand All @@ -202,3 +203,9 @@ kubectl -n kcm-system get secret my-vsphere-clusterdeployment1-kubeconfig -o jso
```shell
KUBECONFIG="my-vsphere-clusterdeployment1-kubeconfig.kubeconfig" kubectl get pods -A
```

To delete provisioned cluster and free consumed vSphere resources run:

```shell
kubectl -n kcm-system delete cluster my-vsphere-clusterdeployment1
```

0 comments on commit ec57200

Please sign in to comment.