TKG Series-Part 3: Deploy TKG Workload (Kubernetes) Cluster

In last post of this series, I covered TKG management cluster setup. In this post we will learn how to deploy TKG workload/compute/kubernetes cluster.

If you have missed earlier post of this series, you can read them from below links:

1: TKG Infrastructure Setup

2: TKG Management Cluster Deployment

Before attempting to deploy TKG workload cluster, ensure you are connected to management cluster context. If you are not already connected to the context, you can use command kubectl config use-context <mgmt-cluster-context-name> to connect to the same.

Step 1: Create a new namespace

An example json file is located in kubernetes official website which I have used to create a test namespace for me. You can create your own json if you want.

# kubectl create -f https://kubernetes.io/examples/admin/namespace-dev.json

Step 2: Create yaml file for workload cluster deployment.

# tkg config cluster mj-tkgc01 –plan dev –controlplane-machine-count 1 –worker-machine-count 3 –namespace development –controlplane-size small –worker-size small > dev.yaml

Step 3: Create Workload Cluster

# tkg create cluster mj-tkgc01 –manifest dev.yaml

Step 4: Get Workload Cluster Credential

# tkg get credentials my-cluster –namespace=my-namespace

Example:

Step 5: Use workload cluster context

root@tkg-client:~# kubectl config use-context mj-tkgc01-admin@mj-tkgc01
Switched to context “mj-tkgc01-admin@mj-tkgc01”.

Step 6: Fetch workload cluster node details

We can clearly see that there is one control-plane node and 3 worker nodes and all are in ready state.

And that completes workload cluster deployment.  We are now ready to deploy applications on top of kubernetes. Stay tuned for part 4 of this series !!!!!

I hope you enjoyed reading the post. Feel free to share this on social media if it is worth sharing 🙂 

Leave a ReplyCancel reply