Skip to content

Cluster internal testing

Cluster internal testing is a method used to verify the functionality and connectivity of services running within a container orchestration cluster (such as Kubernetes) without exposing them to the external internet.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md]

This approach relies on executing diagnostic commands from an ephemeral or testing Pod located inside the cluster network.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md] Because the target service is not exposed externally, standard external tools like curl running on a local machine cannot reach it; instead, the tools must run within the cluster environment.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md]

Methodology

Testing typically involves creating a temporary "dummy" Pod using a container image that includes diagnostic utilities (such as curl).^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md]

For example, to test a service named httpbin on port 8000 from within the cluster, one might execute:

[kubectl](<./kubectl.md>) run -i --rm --restart=Never dummy --image=dockerqa/curl:ubuntu-trusty --command -- curl --silent httpbin:8000/html

This command runs a temporary instance, executes the request against the internal DNS name, and then cleans up the Pod.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md]

Use Cases

  • Connectivity Verification: Ensures a service is reachable via its internal cluster IP or DNS name.
  • Service Mesh Validation: Allows testing of specific routes or features (e.g., retry policies, latency injection) directly within the mesh.
  • Feature Experimentation: Services like httpbin are often deployed internally to safely test various HTTP scenarios and status codes.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md]

Sources

^[400-devops-07-monitoring-and-observability-k8s-istio-samples-httpbin-readme.md]