Get Started with Bitnami Charts using VMware Tanzu Kubernetes Grid (TKG)
VMware Tanzu Kubernetes Grid (TKG) is an implementation of Kubernetes that is tested and supported by VMware. It can run both on-premise in vSphere and in the public cloud. It includes signed and supported versions of open source applications to provide all the key services required for a production Kubernetes environment.
Some of the key advantages of Tanzu Kubernetes Grid are:
- Consistent, secure and upstream-compatible Kubernetes experience
- Pre-integrated and validated components for services such as networking, authentication, ingress control, and logging
- Support for large-scale, multicluster Kubernetes environments with proper workload isolation
- Compatible with private clouds, public clouds and edge environments
- Automated multi-region configuration and policy management
- 24/7 production support from VMware
VMware Tanzu Mission Control (TMC) is a dashboard for centrally provisioning and securing Kubernetes clusters (including TKG clusters) across multiple teams and clouds. Once the cluster is operational, Bitnami’s pre-configured and secure Helm charts can be used to deploy Kubernetes-ready applications on it.
This tutorial will walk you, step by step, through the process of provisioning a new Tanzu Kubernetes Grid cluster on Amazon EC2 using Tanzu Mission Control and then deploying an application on it using Bitnami’s Helm charts.
Assumptions and prerequisites
This guide makes the following assumptions:
- You have access to the VMWare Cloud Services Portal (CSP) and your organization has Tanzu Mission Control available in the “My Services” section in CSP. If not, talk with an expert to request access.
- You have an AWS cloud account connected to Tanzu Mission Control to provision a new cluster on Amazon EC2. Learn how to connect Tanzu Mission Control with an AWS cloud account.
- You have the kubectl CLI and the Helm v3.x package manager installed. Learn how to install kubectl and Helm v3.x.
Step 1: Create a new cluster group
TIP: This step creates a new cluster group in TMC. If you or your organization have already created a cluster group, you can go straight to Step 2.
To create a new cluster group, follow these steps:
Log in to Tanzu Mission Control using the domain provided by your organization or through the CSP console.
Navigate to the “Cluster groups” section and click “New cluster group”.
Give the cluster group a name, add a description and labels (optional), and then click “Create” to finish the process.
Once the new cluster group is created, it will appear in the list of available cluster groups.
Step 2: Provision a new TKG cluster
Tanzu Mission Control allows you to directly provision a TKG cluster from your AWS account. Once the cluster is deployed, you will be able to add new node pools, monitor its workloads, and manage access, image registry and network policies directly from TMC.
To create a new cluster, follow the instructions below:
Navigate to the “Clusters” page.
Click the “New cluster” button and select the AWS account to use for the cluster.
Enter a name for the cluster, choose the cluster group, and click “Next” to continue the process.
Configure your control plane by selecting the purpose of the cluster: development or production. Set the cluster availability zones and click “Next”.
In the resulting screen, check the default node pool and add new worker nodes by clicking “New node pool”. To finish the process, click “Create”.
You will be redirected to the cluster dashboard. The process of creating the cluster may take several minutes. Once the cluster is created, you will see important information related to the nodes, pods, health and resources of the cluster.
Step 3: Connect to the new TKG cluster
To deploy applications in the cluster, it is necessary to first connect to it. To do this, follow the steps below:
Click the “Access this cluster” button in the navigation panel.
Click the “click here” link. Following this link takes you to a page with instructions to download and install the Tanzu Mission Control Command-Line Interface (CLI) (tmc).
On the resulting page, click “Download CLI” and download the CLI for your platform.
Once the download is complete, move the downloaded binary to a directory in your execution path using the instructions shown for your platform.
Execute the command below to start the Tanzu Mission Control CLI:
$ tmc login
You will be prompted for an API token. If you have one, enter it at the prompt or, if not, create a new token as described below.
Navigate to the displayed URL, where you will be further prompted for various inputs to create an API token for Tanzu Mission Control.
- Enter a context name. This name must match your TMC organization domain.
- Select the default values unless you prefer different ones.
Your API token will be created and displayed. Copy the API token and enter it in the Tanzu Mission Control CLI to complete the CLI login process.
Navigate back to the cluster detail page in Tanzu Mission Control. From the “Access this cluster” dialog box, click “Download Kubeconfig file” and configure kubectl to connect to the cluster by executing the command below:
A new window will open in your browser to confirm that the TMC login flow is complete.
Confirm that you are able to successfully access the cluster by running the kubectl cluster-info command.
Step 4: Deploy the Bitnami MariaDB Helm chart on the TKG cluster
To deploy the Bitnami MariaDB Helm chart, follow the instructions below:
Deploy the Bitnami MariaDB Helm chart. Replace the PASSWORD placeholder with a password for the MariaDB administrator account.
$ helm install mariadb oci://registry-1.docker.io/bitnamicharts/mariadb --set rootUser.password=PASSWORD
Once the deployment completes, refer to the output to obtain the MariaDB service URL:
Test the deployment by using the commands below to create a new MariaDB client pod. Replace the PASSWORD placeholder with the MariaDB administrator password.
$ kubectl run mariadb-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mariadb:10.3.23-debian-10-r25 --namespace default --command -- bash $ mysql -h mariadb.default.svc.cluster.local -uroot -pPASSWORD
Execute some example SQL commands using the MariaDB CLI to confirm the operation of the MariaDB cluster:
USE my_database; CREATE TABLE accounts (id INT NOT NULL, username VARCHAR(255) NOT NULL); INSERT INTO accounts VALUES (1, 'james'), (2, 'john'); SELECT * FROM accounts; exit
The following image demonstrates the output you should see:
Step 5: Upgrade the TKG cluster
IMPORTANT: This section only applies to clusters that have been provisioned using Tanzu Mission Control.
You can easily keep the cluster up-to-date using Tanzu Mission Control. Check if there is a new version of the Tanzu Kubernetes Grid available for your cluster by following the steps below:
NOTE: It is highly recommended that you create a backup of the cluster before running the upgrade process. Check out this guide to learn how to backup and restore Bitnami Helm chart deployments using Velero.
Select the cluster to upgrade. If a new version of the Tanzu Kubernetes Grid is available, the “Upgrade” button will be active. Click it to start the upgrade process.
In the resulting window, you will see a warning message about the upgrade process and a list of the latest available version(s) of Tanzu Kubernetes Grid. Select the version you wish to upgrade to and click “Upgrade” to start the process.
Track the progress of the upgrade in the “Clusters” section.
Once the upgrade is complete, the version number associated with your cluster will change to the latest one.