In the previous blog post series, we have successfully completed the deployment of the management cluster. I am adding the links to the previous parts below for your easy access. If you have missed, please check out those blogs before starting with this one.
In this blog post, we will see how to create a TKG workload cluster where we will create our application workloads.
Create workload cluster:
To create a workload cluster, run the below TKG command
tkg create cluster vsphere-workload-1 --plan dev --vsphere-controlplane-endpoint-ip 192.168.100.76
This should not take very long time like the management cluster creation process. You can see the below tkg init log output for the workload cluster creation task.
ubuntu@cli-vm:~$ tkg create cluster vsphere-workload-1 --plan dev --vsphere-controlplane-endpoint-ip 192.168.100.76 Logs of the command execution can also be found at: /tmp/tkg-20210130T000300055730676.log Validating configuration... Creating workload cluster 'vsphere-workload-1'... Waiting for cluster to be initialized... Waiting for cluster nodes to be available... Waiting for addons installation... Workload cluster 'vsphere-workload-1' created
TKG init logs confirms that the workload cluster vsphere-workload-1 that we have created is successfully deployed in the vSphere environment. We can now see 2 additional vms created in the vSphere cluster.
Connect to the workload cluster
You can now run the TKG get cluster command to see the workload cluster created.
tkg get clusters --include-management-cluster
Note: If you want to list only the workload cluster, you can run the above command without the –include-management-cluster option
Run the below tkg command to generate the config file for the workload cluster
tkg get credentials <cluster-name>
This completes the creation of TKG workload cluster. We can not start deploying our application workloads into the workload cluster that we have created.