Skip to content

CICD-155 · Validate a workload manifest against the API ​

Encyclopedia · Kubernetes fundamentals · All snippets

Previous · CICD-154 · Next · CICD-156

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites isolated Kubernetes namespace, kubectl and reviewed manifests.
  • Platforms kubernetes, local-lab.

2. Copy the snippet ​

bash
kubectl -n staging apply --dry-run=server -f manifests/web.yaml

3. How it works ​

Server-side dry run submits the object to API validation and admission without storing it. Keep the context explicit and test actual readiness separately.

4. Verify the result ​

Use a staging identity with necessary dry-run permissions. No workload is persisted.

Validation syntax-validated (Bash parse). Status definitions.