Quick demonstration of how to utilize tkg-cli and Gitlab CICD to provision kubernetes cluster. This allows anyone to provision/scale/delete kubernetes cluster by just committing a cluster definition to git – a common usecase when employing GitOps.
Overview of how it’s done:
- Python script gets executed as part of the GitlabCICD which does a git diff to determine the appropriate action to perform
- Any files added in the cluster folder, perform a tkg create cluster
- Any files modified in the cluster folder, perform tkg scale cluster
- Any files deleted in the cluster folder, perform tkg delete cluster