vSphere with Tanzu and NSX ALB (AVI) Installation, Configuration and Implementation-3

Evren Baycan
6 min readMar 17, 2023

You can access the NSX ALB and Supervisor installation and configuration in the first 2 series via the link below.

vSphere with Tanzu and NSX ALB (AVI) Installation, Configuration and Implementation-1

vSphere with Tanzu and NSX ALB (AVI) Installation, Configuration and Implementation-2

In the last article of the series, we are going to create a Tanzu Kubernetes Cluster. And here we are going to deployment two separate applications both YAML and HELM.

You can access the Tanzu CLI on Namespace. You can make your selection here according to the terminal you are using.

We connect to the Supervisor Cluster via CMD.

kubectl vsphere login --server 80.80.80.11 --vsphere-username administrator@vsphere.local --insecure-skip-tls-verify
kubectl config use-context telco-k8s

Let’s take a tour of Namespace.

kubectl get namespace
kubectl get sc
kubectl get virtualmachineclasses
kubectl get tanzukubernetesreleases

We are preparing a YAML for Tanzu Kubernetes Cluster.

apiVersion: run.tanzu.vmware.com/v1alpha2
kind: TanzuKubernetesCluster
metadata:
name: telco-k8s-cluster
namespace: telco-k8s
spec:
topology:
controlPlane:
replicas: 1
vmClass: best-effort-small
storageClass: tanzu-storage-policy
tkr:
reference:
name: v1.21.6---vmware.1-tkg.1.b3d708a
nodePools:
- name: telco-k8s-pool
replicas: 2
vmClass: best-effort-small
storageClass: tanzu-storage-policy
tkr:
reference:
name: v1.21.6---vmware.1-tkg.1.b3d708a
kubectl apply -f telco-k8s-cluster.yaml

The Tanzu Kubernetes Cluster will take approximately 20–30 minutes to create. If you want to monitor the process, you can use the command below.

kubectl get events -w

You can examine Kubernetes Cluster VMs created on vCenter Inventory Namespace.

Tanzu Kubernetes Cluster definitions were made automatically on NSX ALB.

Again, via the CLI, we connect to the Tanzu Kubernetes Cluster that we have just created.

kubectl vsphere login --server 80.80.80.11 --vsphere-username administrator@vsphere.local --insecure-skip-tls-verify --tanzu-kubernetes-cluster-name telco-k8s-cluster --tanzu-kubernetes-cluster-namespace telco-k8s
kubectl config use-context telco-k8s-cluster

We create the access definition for POD Security.

kubectl create clusterrolebinding default-tkg-admin-privileged-binding --clusterrole=psp:vmware-system-privileged --group=system:authenticated

Let’s deploy a Web Server.

kind: Service
apiVersion: v1
metadata:
name: web-server
spec:
selector:
app: hello
tier: frontend
ports:
- protocol: "TCP"
port: 80
targetPort: 80
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: loadbalancer
spec:
replicas: 2
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
tier: frontend
spec:
containers:
- name: nginx
image: "nginx"
kubectl get services

The Web Server is now running and got the Load Balancer IP on the NSX ALB.

Our Web Server Index page is now coming through the browser.

You can examine the network service on NSX ALB.

Let’s deploy a new application, this time let’s use HELM. My favorite is HELM :)

We download HELM and put it where the kubectl client is.

We add Bitnami as the HELM repository. Bitnami was acquired by VMware, but the Community side is still available. So it is quite reliable.

helm repo add bitnami https://charts.bitnami.com/bitnami

After adding the repository, you can list Bitnami HELM Charts with the command below.

helm search repo bitnami

You can customize the applications you will deploy using HELM parameters.

Let’s deploy RabbitMQ.

helm install rabbitmq --set auth.password=demo1234 --set persistence.storageClass=tanzu-storage-policy --set persistence.accessMode=ReadWriteMany --set persistence.size=1Gi --set service.type=LoadBalancer bitnami/rabbitmq

POD is active. Our PV and PVCs were created automatically and IP assignment was created over Load Balancer as service IP. You can now access the RabbitMQ GUI via the browser.

You can review the service on NSX ALB.

You can review your Namespaces resources on vCenter.

Yes, we have completed this series. With vSphere 8, Tanzu is now perfect.

Thanks.

--

--