Tanzu – vSphere Pods

Want to convert some ESXi hosts into native Kubernetes nodes? Say no more!

Below is a list of commands to get you started on VMware Tanzu vSphere Pods. These were extremely useful to me, and I hope that you find them useful too!

Create the Kubernetes deployment.

# kubectl apply -f /root/Tanzu/vsphere_pod.yaml.yaml

/root/Tanzu/vsphere_pod.yaml (sample yaml file for kubernetes pod)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nextlevelsddc-deployment
  labels:
    app: nextlevelsddc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nextlevelsddc
  template:
    metadata:
      labels:
        app: nextlevelsddc
    spec:
      containers:
      - name: nextlevelsddc
        image: 172.20.10.130/nextlevelsddc:1.17
        ports:
        - containerPort: 80

List the available Kubernetes deployments.

# kubectl get deployment

If the READY column does not display 1/1, wait a few seconds and try the command again.

List the pods in the deployment.

# kubectl get pods

Example:

Display more details about the deployment.

# kubectl describe deployment

SCALE OUT A VSPHERE POD DEPLOYMENT

/root/Tanzu/vsphere_pod_scaled.yaml (sample yaml file for scaled kubernetes pod)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nextlevelsddc-deployment
  labels:
    app: nextlevelsddc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nextlevelsddc
  template:
    metadata:
      labels:
        app: nextlevelsddc
    spec:
      containers:
      - name: nextlevelsddc
        image: 172.20.10.130/nextlevelsddc:1.17
        ports:
        - containerPort: 80

Apply the updated YAML with more replicas set to 3+

# kubectl apply -f /root/Tanzu/vsphere_pod_scaled.yaml

List the available Kubernetes deployments.

# kubectl get deployment

The command should return a value of 3/3 for the Ready, Up-To-Date, and Available columns.

List the pods in the deployment.

# kubectl get pods

Three pods should be now listed.

More information about vSphere Pods service here

Disclaimer: “I am a member of the Tanzu Vanguard community. As an active member, I am passionate about Tanzu and its offerings and willingly share my knowledge and experience with the world. I am not a representative of VMware. My views are my own. If you’d like to learn more about Tanzu Vanguard, please visit https://tanzu.vmware.com/vanguard”