logo

Continuous deployment of Tanzu Kubernetes Cluster using Gitlab CICD

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
The script- feel free to modify:
https://gitlab.com/dmnt3d/tkg-gitlab-cd

Add Kubernetes Cluster

Scale down Kubernetes Cluster

Delete Kubernetes Cluster

Leave a Reply

*

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