If you search for a “Tanzu Kubernetes tutorial” today, most of what comes back is wrong for a current vSphere estate. The product is now vSphere Kubernetes Service (VKS), the TanzuKubernetesCluster API is deprecated, the content library URL has moved to a Broadcom domain, and on VCF 9 the login command most guides start with has been replaced by a new CLI. The concepts underneath survived the renames, which is why the old guides still feel almost right. This walkthrough takes you from an enabled Supervisor to a running VKS cluster with a stateful app, a scale-out and an upgrade, using the APIs and commands Broadcom documents today, and it calls out where vSphere 8 and VCF 9 differ.
Level: intermediate · Stack: vSphere 8.0 U3 or VCF 9.x, vSphere Supervisor, VKS 3.x, VCF CLI or kubectl vsphere plugin · Build time: 2 to 3 hours the first time, most of it Supervisor enablement and image sync
Contents
- What VKS is now, and what it used to be called
- Architecture: Supervisor, namespaces, clusters
- Decisions before you enable anything
- How a kubectl request becomes VMs
- Template: vSphere Namespace checklist
- Template: cluster YAML
- Template: sample stateful app
- End-to-end workflow
- Scaling and upgrading, and what actually happens
- Observability with OpenTelemetry
- Troubleshooting
- What’s next
01. What VKS is now, and what it used to be called
VKS is the service that lets a vSphere Supervisor create and manage conformant Kubernetes clusters whose nodes are ordinary VMs. You describe a cluster in YAML, apply it to the Supervisor’s Kubernetes API, and controllers running on the Supervisor clone node VMs from a content library, bootstrap Kubernetes on them and keep them reconciled. Nothing about that model is new. What changed is almost every name around it, plus two API generations.
| Old name you will find in blogs and KBs | Current name | What actually changed |
|---|---|---|
| — | — | — |
| vSphere with Tanzu, then vSphere IaaS control plane | vSphere Supervisor | Naming only. The Supervisor is still a Kubernetes control plane running on an ESXi cluster. |
| Tanzu Kubernetes Grid Service (TKGS), TKG Service | vSphere Kubernetes Service (VKS) | From vSphere 8.0 Update 3 the service was decoupled from vCenter and shipped as a Supervisor Service (TKG Service 3.0), so it now upgrades independently of vCenter. Current releases are VKS 3.x. |
| Tanzu Kubernetes release (TKr) | vSphere Kubernetes release (VKr) | Same idea: a node OS image plus a Kubernetes version, distributed through a content library. Some field names and labels still say tkr. |
TanzuKubernetesCluster (v1alpha3) | Cluster API Cluster with a versioned ClusterClass | TanzuKubernetesCluster is marked deprecated starting with VKS 3.2. Use cluster.x-k8s.io/v1beta1 on VKS 3.4 and earlier, v1beta2 on VKS 3.5 and later. |
kubectl vsphere login | VCF Consumption CLI, vcf context create | On VCF 9 the docs use the vcf CLI for Supervisor and cluster login. vSphere 8 docs still use the kubectl vsphere plugin. |
wp-content.vmware.com/v2/latest/lib.json | wp-content.broadcom.com/v2/latest/lib.json, or your Software Depot | Subscribed library URL for environments without a Software Depot (for example VVF). Depot-based VCF environments use a URL built from the depot service address. |
| Aria Operations | VCF Operations | Naming only, but it matters when you look for VKS monitoring content. |
Keep the old name in your head, not in your YAML. If a guide starts with
kind: TanzuKubernetesClusteror withkubectl vsphere loginon a VCF 9 system, read it for concepts and take the commands from this post or from the current TechDocs.
02. Architecture: Supervisor, namespaces, clusters
There are three layers, and most confusion comes from mixing them up. The Supervisor is a Kubernetes cluster that runs on your ESXi hosts and whose job is to manage infrastructure. vSphere Namespaces are the tenancy units inside it: each one carries storage policies, VM classes, permissions, optional quotas and a content library association. VKS clusters are the clusters your application teams actually use, and they live inside a namespace as a set of VMs.
What lives where
- vCenter owns the inputs: storage policies (SPBM), the content library that holds VKr images, SSO identities and the Supervisor Management UI.
- The Supervisor control plane runs the VKS controller, Cluster API and the VM Operator. When you apply a
Clusterobject, these controllers do the work. You never SSH to them. - A vSphere Namespace becomes a resource pool in vCenter and a namespace on the Supervisor. Every storage policy you attach shows up as Kubernetes storage classes, and only the VM classes you bind to the namespace can be used for nodes.
- A VKS cluster is control plane VMs plus one or more node pools (MachineDeployments). Inside it you get Antrea as the default CNI and paravirtual CSI and CPI drivers, so a PVC in the cluster becomes a Cloud Native Storage volume on a vSphere datastore and a Service of type LoadBalancer gets a VIP from the Supervisor’s load balancer.
Why VMs and not pods on ESXi
The Supervisor can also run vSphere Pods and plain VMs through the VM Service. VKS clusters are different: they are full upstream-conformant clusters with their own API server, which is what you want for teams that need cluster-admin, CRDs, operators and their own upgrade cadence. The cost is that every cluster carries control plane VMs, so many tiny clusters is an expensive pattern. One namespace per team with one or two clusters each is a sane default.
03. Decisions before you enable anything
Supervisor enablement is a wizard, but several of its answers are hard or impossible to change later. Make these decisions on paper first.
Networking stack and load balancer
| Stack | Load balancer options | Choose it when | Watch out for |
|---|---|---|---|
| — | — | — | — |
| vSphere Distributed Switch (VDS) | Foundation Load Balancer (FLB, introduced with VCF 9 and built into the platform) or Avi Load Balancer | You have no NSX, or you want the simplest path to VKS clusters | FLB is Layer 4 only. Per Broadcom, a VDS-based Supervisor cannot be used by VCF Automation. HAProxy still works on VCF 9.0 but is deprecated and planned for removal in the next major release. |
| NSX segments (classic NSX networking) | NSX load balancer or Avi | You already run NSX and want NSX security and routing for workloads | Needs an NSX Edge cluster sized for the Supervisor and workload traffic. |
| VCF Networking with VPC | Avi, or the native NSX load balancing | You want VCF Automation self-service on top, or VPC-style tenant networks | Broadcom states VCF Automation has a strict dependency on a VPC-based Supervisor. Moving between VDS and VPC means redeploying the Supervisor. |
On vSphere 8 without VCF 9 the choice is the older pair: VDS with Avi (formerly NSX Advanced Load Balancer) or HAProxy, or NSX. Whatever you choose, application-level ingress inside a VKS cluster is still yours to pick: Contour, Gateway API implementations and service meshes run inside the cluster regardless of which platform load balancer the Supervisor uses.
Address plan
- Management network: the Supervisor control plane VMs need a block of consecutive IPs on a network that can reach vCenter (and NSX Manager where used).
- Workload network(s): where node VMs get their addresses. On VDS this is a port group you nominate per namespace. Size it for the largest number of node VMs you will ever run during a rolling upgrade, which is the steady-state count plus surge.
- VIP range: addresses the load balancer hands out for the Supervisor API, every cluster API and every Service of type LoadBalancer. This is the range that runs out first.
- Pod and service CIDRs inside clusters: the defaults in Broadcom’s examples are
192.168.0.0/16for pods and10.96.0.0/12for services, and the docs warn they must not overlap with the Supervisor. They also must not overlap with anything the pods need to reach, such as your NFS array or your corporate DNS.
Storage policy
The namespace only sees storage through policies. Create a dedicated policy for Kubernetes (for example k8s-gold) that resolves to the datastores you want node disks and PVCs on, rather than reusing a VM policy that someone may change. On vSAN that is a capability-based policy; on NFS or VMFS, tag the datastores and use tag-based placement. If you use vSphere Zones, the policy must have the zonal topology set.
VM classes: guaranteed or best effort
VM classes come in two families. Guaranteed classes reserve CPU and memory; best-effort classes do not. Broadcom’s guidance is direct: namespace CPU and memory limits do not affect nodes on guaranteed classes, but they can starve best-effort nodes, and if contention hits the control plane the cluster can stop. Use guaranteed classes for production, and at minimum for control plane nodes.
Content library: subscribed or local
A subscribed library with on-demand download is the low-effort option for connected sites: only metadata syncs until you use a release. Air-gapped sites need a local library that you populate yourself. Pick a naming convention and keep it, because swapping libraries and re-importing images under different names triggers a rolling update of every cluster.
04. How a kubectl request becomes VMs
It helps to know which component is acting at each step, because that tells you where to look when a cluster sits in Provisioning for an hour.
- You authenticate to the Supervisor with vCenter SSO credentials. The CLI writes a kubeconfig context that carries a JSON Web Token for the Supervisor API.
- The request reaches the Supervisor API through its VIP on the load balancer.
- The Supervisor authorizes you through the permissions set on the vSphere Namespace (view, edit or owner) and stores the
Clusterobject. - VKS and Cluster API expand the ClusterClass topology into a control plane object and one MachineDeployment per node pool, after resolving your requested version to a compatible VKr. If no compatible VKr or OS image exists, the request is rejected at this point.
- The VM Operator creates VirtualMachine objects that reference the VM class and storage class.
- vCenter clones the VKr image from the content library and DRS places the VMs, with disks on datastores that match the storage policy.
- The nodes boot, run kubeadm, and VKS installs the CNI, CSI and CPI add-ons.
- The cluster gets its own API VIP and reports Ready (v1beta1) or Available (v1beta2). Everything from here on is a second kubeconfig context.
05. Template: vSphere Namespace checklist
Run this before handing a namespace to a team. Every row has a check you can do from the CLI after the namespace exists.
| Item | Value for this namespace | Why it matters | Check |
|---|---|---|---|
| — | — | — | — |
| Name (DNS-compliant, unique across all Supervisors in this vCenter) | <NAMESPACE> | It becomes a Kubernetes namespace and a resource pool | vcf context list shows it after login |
| Workload network (VDS) or NSX/VPC network override | <WORKLOAD_PORTGROUP> | Node VMs take IPs here | Node IPs in kubectl get machines -o wide |
| Storage policies attached | <STORAGE_POLICY> | Each one becomes storage classes for nodes and PVCs | kubectl describe namespace <NAMESPACE> lists <class>.storageclass.storage.k8s.io/requests.storage |
| Storage limit, per-policy limits | <e.g. 2 TiB> | Caps total PVC and node disk usage | Namespace Summary, Capacity and Usage tile |
| CPU and memory limits | Usually none for VKS | Limits plus best-effort classes can starve control planes | Capacity and Usage tile |
| VM classes bound | guaranteed-medium, guaranteed-large, … | Only bound classes are usable | kubectl get virtualmachineclass |
| Content library associated with VKS | <VKR_LIBRARY> | No library, no releases | kubectl get kr returns compatible releases |
| Permissions | <SSO_GROUP> with Can edit or Owner | Edit is needed to create clusters | Login as a member and run kubectl auth can-i create clusters.cluster.x-k8s.io |
| Supervisor CA trusted on admin workstations | Exported CA file | Avoids skip-TLS habits | vcf context create … --ca-certificate <CA_FILE> succeeds |
| VCF CLI download link given to users | From namespace Summary, Status tile, Link to CLI Tools | The DevOps page is served by the Supervisor control plane load balancer | Link opens from a user workstation |
06. Template: cluster YAML
There are three shapes of cluster manifest in circulation. Use the first one for anything new on a current VKS release.
Current: Cluster v1beta2 with builtin-generic ClusterClass (VKS 3.5 and later)
This follows Broadcom’s minimum example for builtin-generic-v3.6.0 and adds the two customizations most production clusters want: a dedicated containerd volume, so image churn does not fill the root disk, and a default storage class inside the cluster, because many Helm charts assume one exists. Set classRef.name to the newest ClusterClass your VKS version ships; the TechDocs list one page per ClusterClass version.
# app01-cluster.yaml (apply in the Supervisor context, namespace <NAMESPACE>)
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: app01
namespace: <NAMESPACE>
spec:
clusterNetwork:
services:
cidrBlocks: ["10.96.0.0/12"] # must not overlap the Supervisor or anything pods must reach
pods:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
topology:
classRef:
name: builtin-generic-v3.6.0 # newest ClusterClass your VKS version provides
namespace: vmware-system-vks-public
version: <VKR_VERSION> # a release that 'kubectl get kr' shows as compatible
controlPlane:
replicas: 3 # 1 or 3; production needs 3
workers:
machineDeployments:
- class: node-pool
name: np-general
replicas: 3
variables:
- name: vmClass
value: guaranteed-medium
- name: storageClass
value: <STORAGE_CLASS> # storage class name from the namespace
- name: volumes
value:
- name: containerd
mountPath: /var/lib/containerd
storageClass: <STORAGE_CLASS>
capacity: 40Gi
- name: vsphereOptions
value:
persistentVolumes:
availableStorageClasses:
- <STORAGE_CLASS>
defaultStorageClass: <STORAGE_CLASS>
The node OS defaults to Photon. To get Ubuntu nodes (some GPU and driver stacks require it), add metadata.annotations with run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu under controlPlane and under each machine deployment. From VKS 3.4 these annotations must be set in the Cluster topology; annotations set in a ClusterClass are no longer applied.
Same cluster on VKS 3.4 and earlier: Cluster v1beta1
The differences are the API version and class instead of classRef. Use the newest ClusterClass your release ships (for example builtin-generic-v3.4.0 on VKS 3.4).
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: app01
namespace: <NAMESPACE>
spec:
clusterNetwork:
services:
cidrBlocks: ["10.96.0.0/12"]
pods:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
topology:
class: builtin-generic-v3.4.0
version: <VKR_VERSION>
controlPlane:
replicas: 3
workers:
machineDeployments:
- class: node-pool
name: np-general
replicas: 3
variables:
- name: vmClass
value: guaranteed-medium
- name: storageClass
value: <STORAGE_CLASS>
- name: defaultStorageClass
value: <STORAGE_CLASS>
Legacy: TanzuKubernetesCluster v1alpha3 (recognize it, do not start new work on it)
You will meet this in older repos and runbooks. Broadcom marked the API deprecated from VKS 3.2 and points new clusters to the Cluster API. Existing TKC clusters keep working, and the docs include a procedure for retiring TanzuKubernetesCluster resources.
# Deprecated. Shown only so you can recognize it.
apiVersion: run.tanzu.vmware.com/v1alpha3
kind: TanzuKubernetesCluster
metadata:
name: legacy01
namespace: <NAMESPACE>
spec:
topology:
controlPlane:
replicas: 3
vmClass: guaranteed-medium
storageClass: <STORAGE_CLASS>
tkr:
reference:
name: <TKR_NAME>
nodePools:
- name: worker
replicas: 3
vmClass: guaranteed-medium
storageClass: <STORAGE_CLASS>
07. Template: sample stateful app
A StatefulSet is the honest test of a VKS cluster on vSphere because it exercises the whole storage path: a PVC per replica, dynamic provisioning through the paravirtual CSI driver, a CNS volume on your datastore, and re-attachment when a pod moves. It also has to pass Pod Security Admission. VKS releases from v1.26 enforce the restricted profile by default, which is why every container below runs as non-root with dropped capabilities and a seccomp profile. Images come from Docker Hub; if your site is rate-limited or air-gapped, retag them into your own registry.
# demo-app.yaml (apply in the VKS cluster context)
apiVersion: v1
kind: Namespace
metadata:
name: demo
labels:
pod-security.kubernetes.io/enforce: restricted
---
apiVersion: v1
kind: Service
metadata:
name: web-headless
namespace: demo
spec:
clusterIP: None
selector:
app: web
ports:
- name: http
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: web-lb
namespace: demo
spec:
type: LoadBalancer
selector:
app: web
ports:
- name: http
port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
namespace: demo
spec:
serviceName: web-headless
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 101
runAsGroup: 101
fsGroup: 101
seccompProfile:
type: RuntimeDefault
initContainers:
- name: seed
image: busybox:1.37
command: ["sh", "-c", "test -f /data/index.html || echo \"served by $(hostname) from a vSphere CNS volume\" > /data/index.html"]
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
volumeMounts:
- name: html
mountPath: /data
containers:
- name: nginx
image: nginxinc/nginx-unprivileged:1.27-alpine
ports:
- containerPort: 8080
name: http
readinessProbe:
httpGet:
path: /
port: 8080
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: html
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: <STORAGE_CLASS>
resources:
requests:
storage: 1Gi
Two storage classes per policy. For each storage policy on the namespace, a VKS cluster sees a class with the policy’s name (Immediate binding) and a second one with
-latebindingappended (WaitForFirstConsumer). With vSphere Zones, use the late-binding class so the volume is created in the zone where the pod is scheduled.
08. End-to-end workflow
Each step lists what to run and what you should see. Commands use VCF 9 syntax; the vSphere 8 equivalents are at the end of this section. Set the password once per shell with export VCF_CLI_VSPHERE_PASSWORD='…' (read it from your secret store, not shell history) and the CLI will not prompt.
Step 1. Enable the Supervisor
In the vSphere Client, open Supervisor Management and run the wizard with the networking stack, management IPs, workload network, VIP range and storage policy you decided in section 03.
Verify: Supervisor Management > Supervisors: Config Status "Running"
https://<SUPERVISOR_VIP>/ in a browser shows the CLI tools download page
Expected: both true; if the VIP does not answer, the load balancer step failed
Step 2. Create and associate the VKr content library
Create a subscribed library pointing at https://wp-content.broadcom.com/v2/latest/lib.json (no Software Depot) or at your depot URL in the form https://{VcenterLcmDepotServicesAddress}{base_url}/PROD/COMP/VKR/lib.json. Choose “When needed” to download images on demand. Then add the library to VKS on the Supervisor.
Verify: Content Libraries > <VKR_LIBRARY> > Templates > OVF & OVA Templates
Expected: a list of VKr templates (metadata only until first use)
Step 3. Create and configure the vSphere Namespace
Work through the checklist in section 05: network, storage policy, VM classes, content library, permissions.
Verify: Namespace > Summary shows Status, Permissions, Storage, Capacity and Usage,
Content Library and VM Service tiles all populated
Step 4. Install the VCF CLI
Download it from the namespace Summary (Status tile, Link to CLI Tools), rename the binary to vcf and put it on your PATH. Install kubectl as well.
vcf --help
kubectl version --client
Expected: the VCF CLI banner and command list, then a kubectl client version
Step 5. Log in to the Supervisor
vcf context create --endpoint <SUPERVISOR_FQDN_OR_VIP> \
--username <SSO_USER>@<SSO_DOMAIN> \
--ca-certificate <PATH_TO_SUPERVISOR_CA>
vcf context list
vcf context use <NAMESPACE_CONTEXT>
Expected: contexts for the Supervisor and for each namespace you have permissions on
Step 6. Discover what the namespace offers
kubectl get virtualmachineclass
kubectl describe namespace <NAMESPACE> | grep storageclass
kubectl get kr
Expected: your bound VM classes; one line per storage class in the form
<class>.storageclass.storage.k8s.io/requests.storage;
releases with compatibility reported as True for at least one version
If kubectl get kr is empty, the library is missing, not synchronized, or not associated with VKS on this Supervisor. On VKS releases before 3.2 the resource is tanzukubernetesreleases (tkr).
Step 7. Create the cluster
Fill in <NAMESPACE>, <STORAGE_CLASS> and <VKR_VERSION> in the section 06 template, then apply it.
kubectl apply -f app01-cluster.yaml
Expected: cluster.cluster.x-k8s.io/app01 created
Step 8. Watch it provision
kubectl get cluster app01 -w
kubectl get machines
kubectl get virtualmachines
Expected: PHASE moves from Provisioning to Provisioned (first use of a release is slower,
because an on-demand library downloads the VKr image first);
6 machines Running; matching VMs visible under the namespace in vCenter
To confirm health precisely, read the condition rather than the phase: Ready on v1beta1 clusters, Available on v1beta2.
kubectl get cluster app01 -o jsonpath='{.status.conditions[?(@.type=="Available")].status}'
Expected: True
Step 9. Log in to the cluster
vcf context create --endpoint <SUPERVISOR_FQDN_OR_VIP> \
--username <SSO_USER>@<SSO_DOMAIN> \
--ca-certificate <PATH_TO_SUPERVISOR_CA> \
--workload-cluster-name app01 \
--workload-cluster-namespace <NAMESPACE>
vcf context list
vcf context use <APP01_CONTEXT>
kubectl get nodes
Expected: "Logged in successfully"; 6 nodes in Ready state (3 control plane, 3 workers)
Log in only after all nodes are ready. Broadcom notes that login can be unreliable while worker nodes are still being created. If your Supervisor uses an external identity provider through Pinniped, use the cluster plugin instead: vcf cluster kubeconfig get app01 --export-file ~/app01.kubeconfig from the namespace context.
Step 10. Check storage classes inside the cluster
kubectl get storageclass
Expected: <STORAGE_CLASS> marked (default) and <STORAGE_CLASS>-latebinding
Step 11. Deploy the sample app
kubectl apply -f demo-app.yaml
kubectl -n demo rollout status statefulset/web
kubectl -n demo get pvc
kubectl -n demo get svc web-lb
curl http://<EXTERNAL_IP>/
Expected: 2 PVCs Bound (html-web-0, html-web-1); web-lb shows an EXTERNAL-IP from the
VIP range; curl returns "served by web-0 ..." or "served by web-1 ..."
Step 12. See it from the vSphere side
In the vSphere Client, select the vSphere cluster, then Monitor, Cloud Native Storage, Container Volumes. Each PVC appears as a CNS volume with the Kubernetes cluster, namespace and PVC name attached. This is the view your storage team will use when they ask which datastore a pod’s data is on.
Step 13. Scale (section 09 explains the mechanics)
# Supervisor context: add a worker
vcf context use <NAMESPACE_CONTEXT>
kubectl patch cluster app01 --type json \
-p '[{"op":"replace","path":"/spec/topology/workers/machineDeployments/0/replicas","value":4}]'
kubectl get machines -w
# Cluster context: add a replica
vcf context use <APP01_CONTEXT>
kubectl -n demo scale statefulset web --replicas=3
kubectl -n demo get pvc
Expected: a 7th machine reaches Running and a 4th worker joins; a third PVC html-web-2 is Bound
Step 14. Upgrade
vcf context use <NAMESPACE_CONTEXT>
kubectl get cluster app01 -o jsonpath='{.status.conditions[?(@.type=="UpdatesAvailable")].message}'
vcf cluster available-upgrades get app01 -n <NAMESPACE>
vcf cluster upgrade app01 -n <NAMESPACE> --kr <TARGET_VKR>
Expected: a list of newer compatible releases, then
"Cluster 'app01' successfully upgraded to kubernetes version '<TARGET_VKR>'"
and a rolling replacement of control plane nodes first, then workers
The kubectl alternative is to edit spec.topology.version with kubectl edit cluster/app01. Do not edit the TKR_DATA variable; VKS maintains it.
vSphere 8 equivalents for the login steps
On vSphere 8 Supervisors the documented tool is the Kubernetes CLI Tools for vSphere download (the kubectl vsphere plugin), from the same namespace link. The password can come from KUBECTL_VSPHERE_PASSWORD.
kubectl vsphere login --server=<SUPERVISOR_FQDN_OR_VIP> \
--vsphere-username <SSO_USER>@<SSO_DOMAIN>
kubectl config use-context <NAMESPACE>
kubectl vsphere login --server=<SUPERVISOR_FQDN_OR_VIP> \
--vsphere-username <SSO_USER>@<SSO_DOMAIN> \
--tanzu-kubernetes-cluster-namespace <NAMESPACE> \
--tanzu-kubernetes-cluster-name app01
kubectl config use-context app01
09. Scaling and upgrading, and what actually happens
Scaling node pools
Node pool size is just replicas on a machine deployment in the Cluster topology, so you can change it with kubectl patch, kubectl edit or by re-applying the manifest from Git. Scale-out is cheap: a new VM is cloned and joins. Scale-in deletes machines, and Cluster API drains each node first, so PodDisruptionBudgets are respected. Two consequences are worth planning for.
- Namespace quota and VIPs. A scale-out that would exceed the namespace storage limit fails at the VM level. Check the Capacity and Usage tile before large changes.
- Different shapes need different pools. If you need bigger nodes, add a second machine deployment with a different
vmClassoverride rather than changing the class on the existing pool. Changing the VM class or storage class of an existing pool is supported, but it triggers a rolling replacement of every node in it.
VKS also supports autoscaling node pools; the TechDocs section “Autoscaling VKS Clusters” covers the setup for your release. Autoscaling changes the same replica counts, so do not also manage them from Git or the two will fight.
Upgrading clusters
Upgrades are rolling replacements, not in-place package updates. The controllers add a node on the new version, wait for it to become ready, then cordon, drain and delete an old one, control plane first and then workers. The old node is not deleted until all its pods are evicted, so a PodDisruptionBudget that cannot be satisfied will stall the upgrade with a cordoned node sitting there. Bare pods without a controller are deleted during the drain and not recreated.
Three rules keep upgrades boring:
- Check compatibility first.
kubectl get krshows which releases are compatible with the installed VKS version, and the cluster’sUpdatesAvailablecondition lists the recommended next versions. - Move one minor version at a time. Kubernetes itself does not support skipping minor versions, and the recommended list reflects that.
- Keep VKS current, separately. Since the service was decoupled, upgrading vCenter or the Supervisor no longer upgrades VKS, and from VKS 3.0 those upgrades do not by themselves roll your clusters. Upgrading VKS can trigger rolling updates, so schedule VKS upgrades as change windows. On older stacks (before VKS 3.0), Supervisor upgrades could roll every cluster.
Surprise rollouts. Switching the content library that serves VKr images, or re-importing the same images under different names, triggers a rolling update of all clusters. So does changing a namespace setting that propagates to clusters. If node VMs start cycling and nobody touched a cluster, check those first.
10. Observability with OpenTelemetry
Broadcom documents monitoring VKS clusters through VCF Operations, which gives the infrastructure view: node VM health, capacity, and the link from clusters to the vSphere objects underneath. For application and Kubernetes-level telemetry the usual pattern is an OpenTelemetry Collector DaemonSet in each VKS cluster that ships pod logs, kubelet metrics and application OTLP data to a central gateway. Part 5 of the OTel for vSphere admins series covers the full agent and gateway design. Here is the minimum to get a VKS cluster sending data.
Two VKS-specific details matter. First, Pod Security Admission: log collection needs hostPath mounts, which the restricted profile rejects, so the collector’s namespace must be labeled privileged and nothing else should run there. Second, control plane nodes are tainted, so the DaemonSet needs a toleration if you want their logs.
Collector component names changed in late 2026. Current contrib and k8s distributions use snake_case types such as k8s_attributes, kubelet_stats, file_log and otlp_http; the old names (k8sattributes, kubeletstats, filelog, otlphttp) still work as deprecated aliases. The batch processor is deprecated in favor of exporter-side batching with sending_queue.batch. The Helm chart’s presets already emit the new names.
# otel-agent-values.yaml for the opentelemetry-collector Helm chart (0.184.x)
mode: daemonset
image:
repository: otel/opentelemetry-collector-k8s
tag: "0.166.0"
presets:
kubernetesAttributes:
enabled: true
kubeletMetrics:
enabled: true
logsCollection:
enabled: true
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
resources:
limits:
memory: 512Mi
config:
processors:
resource/cluster:
attributes:
- key: k8s.cluster.name
value: <CLUSTER_NAME>
action: upsert
- key: vsphere.namespace
value: <NAMESPACE>
action: upsert
exporters:
otlp_http:
endpoint: http://<OTEL_GATEWAY_FQDN>:4318
sending_queue:
batch: {}
service:
pipelines:
logs:
receivers: [otlp]
processors: [memory_limiter, resource/cluster]
exporters: [otlp_http]
metrics:
receivers: [otlp]
processors: [memory_limiter, resource/cluster]
exporters: [otlp_http]
traces:
receivers: [otlp]
processors: [memory_limiter, resource/cluster]
exporters: [otlp_http]
The presets add the file_log receiver to the logs pipeline, kubelet_stats to the metrics pipeline and k8s_attributes to every pipeline, along with the RBAC and volume mounts they need. vsphere.namespace is a custom attribute, not a semantic convention; it is there so a Grafana query can join cluster telemetry to the vSphere Namespace and from there to the node VMs.
kubectl create namespace otel
kubectl label namespace otel pod-security.kubernetes.io/enforce=privileged
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm upgrade --install otel-agent open-telemetry/opentelemetry-collector \
-n otel --version 0.184.1 -f otel-agent-values.yaml
kubectl -n otel get daemonset
kubectl -n otel logs daemonset/otel-agent-opentelemetry-collector-agent --tail=20
Expected: DESIRED and READY equal to the node count (6 with the toleration);
no "permission denied" on /var/log/pods; no exporter errors to the gateway
If the DaemonSet shows zero pods and the events mention PodSecurity, the namespace label is missing. If kubelet metrics are empty, look for certificate errors to the kubelet on port 10250 in the agent logs.
11. Troubleshooting
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| — | — | — | — |
kubectl get kr returns nothing | Content library not created, not synchronized, or not associated with VKS on this Supervisor | Content Libraries view; Supervisor VKS settings | Associate the library; on “When needed” libraries, metadata must sync before releases appear |
| Cluster apply rejected with a release or image error | Requested version does not resolve to a compatible, ready VKr or OS image | kubectl get kr compatibility; the resolve-os-image annotation | Pick a compatible version; for Ubuntu nodes make sure an Ubuntu image exists for that release |
| Cluster stuck in Provisioning, no VMs in vCenter | VM class not bound, storage class not on the namespace, or quota exhausted | kubectl get virtualmachineclass; kubectl describe virtualmachine events | Bind the class, attach the policy, raise the limit |
| VMs exist but stay powered off or never get an IP | Workload network has no free IPs, or DHCP or IP pool misconfigured | kubectl get virtualmachines -o wide; port group IP usage | Enlarge the workload network range; remember surge during upgrades |
| Cluster API VIP never appears | VIP range exhausted or load balancer unhealthy | Load balancer UI; Supervisor events | Add VIP capacity; fix the load balancer before anything else |
Login returns Error from server (Forbidden) | User lacks permission on the namespace | Namespace Permissions tile | Grant Can edit or Owner to the user or SSO group |
| Login works for the Supervisor but not the cluster | Cluster not fully ready, or an external IdP is configured | Node readiness; Supervisor identity settings | Wait for all nodes; with Pinniped use vcf cluster kubeconfig get |
| Pods rejected with “violates PodSecurity restricted” | PSA enforced by default on v1.26 and later | kubectl get ns --show-labels | Add securityContext as in section 07, or label a dedicated namespace with a weaker profile |
| PVC stays Pending | Wrong storage class name, late binding waiting for a pod, or datastore full | kubectl describe pvc; Cloud Native Storage view | Use a class that exists; schedule the pod; free or add capacity |
| Upgrade stalls with a cordoned node | PodDisruptionBudget cannot be satisfied | kubectl get pdb -A; machine conditions | Scale the workload or relax the PDB for the window |
| Every cluster started rolling with no change made | Content library swapped or VKS upgraded | vCenter tasks; VKS version | Expected behavior; schedule library and VKS changes as change windows |
kubectl vsphere fails on a VCF 9 system | Plugin replaced by the VCF CLI | Supervisor version | Use vcf context create |
12. What’s next
You now have a VKS cluster built from the current API, a stateful workload on vSphere storage, and a collector shipping its telemetry. For the bigger picture of running applications on VMware, including the non-Supervisor options, read Step by step guide: running Kubernetes applications in a VMware environment. To take observability further, Part 5: OpenTelemetry for Kubernetes on vSphere builds the agent and gateway tiers properly, and Part 6 follows one slow request from a trace down to the pod, the node VM, the ESXi host and datastore latency, which is exactly the path the StatefulSet in this post exercises. If your next cluster needs GPUs, running LLM inference on vSphere with NVIDIA vGPU covers the host, VM and sizing side.
Checked against Broadcom TechDocs for vSphere Supervisor 9.0 services (VKS 3.x, builtin-generic ClusterClass v3.4.0 to v3.6.0), the VCF 9 load balancer guidance, and the OpenTelemetry Collector 0.166.0 and Helm chart 0.184.1. ClusterClass versions, VKr names and CLI syntax move quickly; confirm them against the TechDocs page for your exact VKS release before automating anything.
Leave a Reply