Study FAQ
How do I read and validate a Kubernetes YAML manifest before applying it to VKS?
Also asked as 2
- What should I check in workload YAML before using kubectl against a VKS cluster?
- How can I check a Kubernetes manifest against VKS without creating the workloads?
Answer
Read the manifest's apiVersion, kind, metadata, and object fields, often under spec. Check whether the resource is supported by the target VKS workload cluster and which namespace it belongs to. With access and the necessary API permissions, run kubectl apply --dry-run=server against that cluster to have its API evaluate the request without persisting the change.
For an ordinary namespaced workload manifest, use a kubectl version compatible with the cluster. Confirm the API endpoint and identity represented by your context and check the intended namespace, including any metadata.namespace in the file.
kubectl config get-contexts
kubectl --context "vks-workload-context" -n "app-namespace" apply --dry-run=server -f workload.yaml
Replace the example context and namespace with your own. A successful dry run shows the submitted resources passed the API checks for that request. Controllers still have to reconcile real objects after application. Review manifests in version control and verify rollout and workload readiness after a separately authorized apply.
Full explanation
Kubernetes Fundamentals for VMware vSphere Administrators
Study guide · 3V0-24.25
Read the full explanation