August 28, 2026

Testing Kubernetes applications requires validating behaviors that container-level tests and standard integration test suites do not cover: deployment rollouts that shift traffic progressively across pod versions, health probe configurations that determine when Kubernetes routes traffic to a pod or terminates it, service mesh policies that enforce retry logic and circuit breaking at the network layer, and ConfigMap-driven configuration that changes application behavior without code changes. A test suite that passes at the container level while ignoring these Kubernetes-level behaviors leaves the most operationally significant failure modes untested. A misconfigured liveness probe causes repeated pod restarts that degrade production availability without triggering any application-level alert. A readiness probe with incorrect timing keeps traffic flowing to pods that are not ready to serve requests. A service mesh retry policy configured without timeout bounds amplifies load spikes into cascading failures. None of these appear in unit tests or integration tests that run outside a Kubernetes environment.
Container-level tests — unit tests, integration tests, and API tests run against a containerized application in isolation — validate the application binary. They validate that the application code behaves correctly given specific inputs, that services return expected responses, and that internal business logic produces correct outputs. What they do not validate is how the application behaves within the Kubernetes orchestration layer, where the runtime environment includes components outside the container: the scheduler, the kubelet, the network plugin, the service registry, and any service mesh or ingress controller sitting between services.
The gap between container-level test results and Kubernetes-level behavior appears in four areas. First, resource limits and pod scheduling: a container that runs correctly in a local Docker environment may fail in Kubernetes when its memory limit is hit and the container is OOM-killed, when CPU throttling causes request timeouts, or when node affinity rules cause the pod to be scheduled on a node where the required persistent volume is not available. These failures do not appear in container-level tests because resource constraints are not applied.
Second, ConfigMap and Secret injection: Kubernetes injects configuration into containers as environment variables or mounted files at pod startup. A ConfigMap with an incorrect key name, a Secret with a missing value, or an environment variable that is consumed at startup but validated only at runtime will cause the application to fail in Kubernetes even if all application-level tests pass, because the tests do not inject the same configuration path that Kubernetes uses. Third, service discovery: in a local Docker Compose setup, services discover each other by container name. In Kubernetes, service discovery depends on DNS resolution through the kube-dns service, service selector matching, and endpoint propagation. Tests that pass in Docker Compose may fail in Kubernetes when service names, ports, or namespace prefixes differ from what the application expects. Fourth, lifecycle events: Kubernetes sends SIGTERM to pods before termination and expects graceful shutdown within a configurable termination grace period. Applications that do not handle SIGTERM correctly drop in-flight requests during rolling deployments. This behavior is not tested by container-level tests. For teams building test coverage for Kubernetes-deployed applications, Astaqc test automation services can design a testing strategy that covers the Kubernetes-level validation layer in addition to container-level and API tests. The complete software testing guide situates infrastructure-level testing within a full quality strategy.
Kubernetes rolling deployments replace running pods incrementally, using the maxSurge and maxUnavailable parameters in the Deployment spec to control how many pods can be added or removed at each step. The default values (25% maxSurge, 25% maxUnavailable) mean that during a rolling update, up to 25% of pods may be running the old version while 25% additional pods are added running the new version. Testing a rolling deployment means validating that the application handles concurrent traffic across two versions without errors, that in-flight requests are not dropped during pod termination, and that the new version reaches a ready state within the expected time window before the rollout continues to the next batch.
A practical approach to deployment rollout testing uses a smoke test suite that runs immediately after each deployment step and validates that the new pods are handling requests correctly before the rollout proceeds. This can be implemented as a Kubernetes Job that triggers after the Deployment’s minReadySeconds period and calls key application endpoints, checking for correct responses. If the smoke test fails, the rollout is paused and a rollback is triggered automatically. This pattern catches deployment failures earlier than health probe failures do, because health probes validate only that the process is alive and can handle a specific probe request, not that the application is handling real production traffic correctly.
Rollback validation should be part of the deployment test strategy. A Deployment rollback (kubectl rollout undo) reverts to the previous ReplicaSet, but the rollback itself is another rolling deployment that goes through the same maxSurge/maxUnavailable cycle. Testing that a rollback completes successfully and that the previous version’s smoke tests pass after rollback is an important coverage gap in most Kubernetes test strategies. This is particularly relevant when the new version’s database migration is not backward-compatible with the previous version’s code, a scenario where a rollback restores the old code but leaves the new schema in place, causing failures that the rollback is expected to fix. For teams assessing their deployment test coverage, Astaqc software testing services can evaluate the rollout validation strategy and identify gaps in deployment testing. The AI in software testing guide covers how automated testing fits into continuous deployment pipelines.
Kubernetes health probes determine when a pod is ready to receive traffic, when it should be restarted, and when it needs additional startup time. Misconfigured probes are one of the most common sources of production instability in Kubernetes deployments, and they are rarely covered by application-level tests because they operate outside the application code path.
| Probe Type | What It Tests | Failure Consequence | Common Misconfiguration |
|---|---|---|---|
| Liveness probe | Whether the container process is alive and responsive | Kubernetes restarts the container; repeated failures trigger a CrashLoopBackOff | Probe checks a path that includes database connectivity; DB slowdown causes pod restarts |
| Readiness probe | Whether the container is ready to receive traffic | Pod is removed from the Service endpoint list; traffic is not routed to it | Probe timeout too short; pod is marked not ready during normal startup latency |
| Startup probe | Whether a slow-starting container has completed initialization | If startup probe fails within failureThreshold * periodSeconds, Kubernetes kills the container | failureThreshold too low for the application’s normal startup time; kills healthy containers |
Testing health probe configuration requires more than checking that the probe endpoint returns 200 under normal conditions. It requires validating probe behavior under the conditions that cause misconfigurations to manifest: startup under database connection delays, behavior when an upstream dependency is slow, and behavior under CPU throttling when the probe request takes longer than the configured timeoutSeconds.
A structured health probe test validates four things: first, that the liveness endpoint path responds within the configured timeoutSeconds under normal load; second, that the liveness probe does not fail under load conditions that should not cause a restart, specifically, that the probe does not check external dependencies whose latency is outside the application’s control; third, that the readiness probe correctly returns a non-200 response during the application startup phase, before the application is ready to serve requests; and fourth, that the startup probe’s failureThreshold * periodSeconds window is longer than the application’s maximum observed startup time under the CPU limit constraints applied in the Deployment spec.
The most damaging liveness probe misconfiguration is a probe that checks external dependencies — a database connection, a Redis availability check, or a downstream API call — as part of the liveness check. When those dependencies are slow or unavailable, the liveness probe fails and Kubernetes restarts the pod. But restarting the pod does not fix the external dependency; it just means that all in-flight requests are dropped, the pod restarts, and the probe fails again immediately, creating a restart loop that takes healthy application pods offline during a database slowdown rather than waiting for the database to recover. Liveness probes should check only the application process’s responsiveness, not external dependencies. External dependency health belongs in a readiness probe, where failure removes the pod from traffic rotation rather than restarting it. For teams auditing their Kubernetes health probe configuration, Astaqc performance testing services can validate probe behavior under load conditions that reveal misconfiguration before it causes production incidents. The software testing cost guide covers how to prioritize infrastructure testing investments relative to application-level test coverage.
Service meshes — Istio, Linkerd, Cilium — add a network proxy layer (sidecar or eBPF-based) to every pod that intercepts and controls all inter-service traffic. This layer enforces retry policies, timeout policies, circuit breaker rules, traffic routing weights, and mTLS authentication between services. The application code is unaware of these policies; they are configured through mesh-specific CRDs (Istio VirtualService and DestinationRule, Linkerd ServiceProfile) and enforced at the network layer. This means that application-level tests that bypass the mesh will not validate mesh policy behavior, and mesh misconfiguration causes failures that application-level tests cannot detect.
Retry policy testing is one of the most important service mesh test cases because retry policies can amplify load. A retry policy configured to retry failed requests up to 3 times with no timeout bound means that a service under load that returns 503 errors will receive 3x the original request volume from retries, potentially compounding the overload rather than relieving it. Testing retry policy behavior requires sending requests that trigger the retry condition — typically a 503 or a connection timeout — and validating that the retry behavior matches the configured policy: the correct number of retries, the correct retry conditions (which HTTP status codes trigger a retry), and the correct backoff delay between retries. This test must run against the application in a Kubernetes cluster with the mesh sidecar injected, not against the application in isolation.
Circuit breaker testing validates that the mesh’s circuit breaker opens (stops sending requests to an unhealthy upstream) when the upstream exceeds the configured consecutive error threshold, and that the circuit breaker closes (resumes sending requests) after the configured recovery window. Testing circuit breaking requires a mechanism to make the upstream service return errors in a controlled way — typically using a Fault Injection resource in Istio or a ServiceProfile error budget in Linkerd to inject synthetic errors at the proxy layer without changing the application code. The test asserts that traffic to the unhealthy upstream drops to zero within the expected window, that the circuit breaker opens, and that traffic resumes after the recovery period.
| Service Mesh Test Scenario | How to Implement | What to Assert |
|---|---|---|
| Retry policy behavior | Use Istio FaultInjection to return 503 from upstream; send 100 requests; inspect proxy metrics | Total requests = original + (original × retry count); retry conditions match configured HTTPRetry rules |
| Circuit breaker opening | Inject errors above consecutive error threshold; monitor Envoy outlier detection metrics | Upstream ejected from load balancing pool within expected time; 503 responses from circuit breaker |
| Traffic weight routing | Deploy two versions with VirtualService weight split; send 1000 requests; inspect response headers or version metrics | Traffic distribution within ±5% of configured weights (80/20 or canary split) |
| mTLS enforcement | Configure PeerAuthentication STRICT mode; attempt connection from pod without sidecar injection | Unauthenticated connection rejected; mutual TLS required for all inter-service traffic |
For teams running Istio, the primary testing surface is the Envoy proxy sidecar’s metrics exported to Prometheus: istio_requests_total with labels for source, destination, response code, and response flags gives per-request observability that application-level logs do not provide. Service mesh tests that assert on these metrics rather than application responses catch mesh policy mismatches that the application itself is unaware of. For teams building service mesh test coverage, Astaqc manual testing services can design exploratory test scenarios for service mesh failure modes that automated tests miss. The manual vs. automated testing guide covers how to decide which Kubernetes-level behaviors are best validated through automated tests versus structured exploratory testing.
The right approach is a two-tier model: a lightweight Kubernetes environment (minikube, kind, or a small ephemeral cluster) runs in CI for each pull request, covering health probe validation, ConfigMap injection checks, and basic service connectivity. A full staging environment that mirrors production cluster configuration runs the complete Kubernetes-level test suite including service mesh behavior, node affinity and resource limit testing, and rollout validation. Running everything in a production-equivalent environment for every pull request is too slow and expensive; running nothing in a Kubernetes environment until staging means that configuration bugs are not caught until late in the deployment pipeline.
The most widely used tools for Kubernetes-level testing in 2026 are: k6 and Locust for load testing that runs against a Kubernetes-deployed application under realistic traffic conditions; Chaos Mesh and LitmusChaos for fault injection (pod deletion, network partition, latency injection, resource exhaustion); kube-score and Polaris for static analysis of Kubernetes manifests, catching health probe misconfigurations and security policy violations before deployment; and Testkube for running test suites as Kubernetes-native jobs. For service mesh testing, Kiali (Istio observability) and Prometheus with the Istio metrics adapter provide the per-request visibility needed to validate mesh policy behavior.
HorizontalPodAutoscaler (HPA) testing requires generating a load profile that triggers the autoscaler and validating that new pods are scheduled and reach a ready state within the expected time. The test generates load at a level that exceeds the HPA’s CPU or custom metric threshold, then monitors the HPA’s status (kubectl get hpa) and the number of ready pods at intervals. The test asserts that the pod count reaches the target replica count within the expected scale-out window, that the new pods pass their readiness probes before receiving traffic, and that when load drops below the scale-down threshold, the replica count returns to the minimum after the stabilization window elapses. Testing autoscaling in a CI environment requires a cluster with enough capacity to actually schedule the additional pods; a single-node kind cluster cannot validate autoscaling behavior that requires multi-node scheduling.
A minimal Kubernetes test strategy for a team starting from scratch covers three areas in priority order. First, health probe validation: deploy the application in a Kubernetes cluster, verify that the liveness and readiness probes respond correctly at startup and under normal load, and verify that the liveness probe does not check external dependencies. Second, ConfigMap and Secret injection: deploy with the production ConfigMap structure, verify that the application starts correctly, and verify that each required configuration key is present and has a valid value format. Third, rolling deployment smoke tests: trigger a deployment update and run a smoke test suite against the service endpoint during the rollout, confirming that the service returns correct responses from both the old and new pod versions during the transition. These three cover the most common Kubernetes-level failure modes without requiring service mesh infrastructure or chaos engineering tooling. For teams building from this baseline, Astaqc test automation services can design the next tier of coverage that includes service mesh testing and fault injection. The outsourcing QA guide covers how to engage external expertise for Kubernetes testing without requiring in-house Kubernetes infrastructure engineering experience.
Graceful shutdown testing sends SIGTERM to a running pod while active requests are in flight and asserts that all in-flight requests complete before the process exits, that no requests return a 502 from the load balancer (indicating the pod stopped accepting connections before Kubernetes removed it from the endpoint list), and that the process exits within the configured terminationGracePeriodSeconds. The test can be implemented using kubectl delete pod and a concurrent load generator: the load generator runs during the pod deletion, and the test validates that no requests fail during the graceful shutdown window. For applications that do not implement a SIGTERM handler, this test reveals the problem before a rolling deployment causes dropped requests in production. For teams assessing deployment validation coverage, Astaqc hire QA team can include graceful shutdown testing as part of a standard Kubernetes deployment review.
Container-level tests validate application logic in isolation; Kubernetes-level testing validates deployment rollouts, health probe behavior, and service mesh policies — the operational layer that determines whether the application stays available under real production conditions.


Sign up to receive and connect to our newsletter