logo

[TKG Series – Part 3] Creating custom plan in Tanzu Kubernetes Grid

TKG Series

For this post, I’ll be showing how to create custom plan that can be used when provisioning kubernetes clusters using tkg. Plan is used to define specifics of the provisioning including configuration resources of the deployed VM/ nodes. By default, tkg uses the same machine configuration (cpu/mem/target datastore) that was used for the tkg management plane for the succeeding kubernetes cluster(s). Adding a custom plan is necessary if you want to scale or specify this aspects of the deployed kubernetes cluster(s)

Location of tkg plan

By default, it’s located inside .tkg folder where you initiated the tkg management install. In my previous example, is at the control vm.


/root/.tkg/providers/infrastructure-vsphere/v0.6.3
I’m using root. Also created two custom plans in the screenshot

Creating custom Plan

  • Copy the out-of-the-box plan

cp cluster-template-prod.yaml cluster-template-sample.yaml
  • Modify the custom plan you just created using your favorite text editor
  • For this plan, I’ll modify the master and worker node resource configuration.
  • To specify worker nodes resources, go to the VSphereMachineTemplate kind and modify the resource
I’ve modified the memoryMiB and numCPUs portion
  • To specify master nodes resources, copy the VSphereMachineTemplate kind and create one just for master. Change the name to identify it’s for master node
I’ve named mine to -control to identify this VSphereMachineTemplate is for master node
  • Next, to specify master nodes will be using the previous template, go to kind: KubeadmControlPlane and specify the infrastructureTemplate to use
Yellow box
  • …and you’re all set

Creating custom Plan

To use the plan, just specify the plan when creating the kubernetes cluster using the tkg cli


 tkg create cluster helloworld --plan sample --kubernetes-version v1.17.3+vmware.2 --controlplane-machine-count 1 --worker-machine-count 1
  1. Pingback: A private cloud – all for myself » [TKG Series – Part 2] Install Kubernetes Cluster(s) using Tanzu Kubernetes Grid

  2. Pingback: Insecure Harbor registry with Tanzu Kubernetes Grid+ on vSphere – beepboop computer

Leave a Reply

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.