Table of Contents
Table of Contents
Further Reading
Why pre-flight testing matters for Kubernetes
Pre-flight testing is a safety mechanism for fast-moving continuous deployment. In Kubernetes, one small misconfiguration can break many services at once.
Catching that error before the change applies is far cheaper than recovering from an outage.
Key components of pre-flight testing
- Configuration validation: check manifests, Helm charts, and YAML for syntax and schema errors
- Dependency verification: confirm images, Secrets, ConfigMaps, volumes, and services exist
- Policy and security checks: verify resource limits, quotas, RBAC, and admission policies
- Dry-run execution: simulate changes with dry runs or in sandboxed namespaces
How a pre-flight check runs
- A change is proposed, such as a Helm upgrade or manifest update.
- Static checks lint and validate the configuration.
- Dependency and policy checks run against the target cluster.
- A dry run previews what will be created, changed, or deleted.
- The change applies only if every check passes.
Pre-flight vs. post-flight testing
Pre-flight testing guards the door. Post-flight testing confirms everything still works after the change.
Practical pre-flight testing examples
- Helm validation: a Testkube workflow checks chart values and template rendering before a production upgrade
- Server-side dry runs: kubectl apply with server-side dry run previews resource changes
- Pipeline config checks: verify environment variables, secrets, and settings exist
- Network checks: validate network policies and ingress rules before routing changes
- Quota checks: confirm resource quotas allow a planned scale-up
Consider a SaaS team upgrading a shared ingress controller. A pre-flight dry run shows the new chart would delete an existing route. They fix the values before any customer traffic is affected.
Best practices for pre-flight testing
Integrate into CI/CD early
Make pre-flight tests mandatory pipeline steps. Run them before merges and deployments.
Combine static and dynamic validation
Use linting and schema checks along with live cluster validation. Each catches different problems.
Automate failure response
Stop the rollout and alert the team when a check fails. Nobody should need to watch logs.
Create reusable templates
Standard validation templates keep checks consistent across teams and services.
Test against production-like environments
Run checks where policies, quotas, and versions match production.
Common pitfalls to avoid
- Limited coverage: checks run only in staging without production-like settings
- Optional validation: pre-flight tests treated as advice instead of a gate
- Partial dependency checks: cross-namespace or cross-cluster links go unverified
- Ignored policies: RBAC and admission rules that silently block changes
- No dry runs: static checks alone miss runtime problems
How pre-flight testing relates to Testkube
Testkube automates pre-flight checks within continuous testing workflows. Tests trigger before deployments or configuration changes and run inside the Kubernetes environment.
- Config validation: Helm charts, manifests, and secrets checked in-cluster
- Automated triggers: checks run before deployment events
- Quality gates: production updates apply only after every check passes
- Central results: pre-flight outcomes recorded with the rest of your test history



