Avatar

Quickly get a curl debugging shell in a k8s cluster

To get a quick shell session where you can use cURL to debug HTTP connectivity issues inside a Kubernetes cluster, run

$ kubectl run curl-debug --image=curlimages/curl -i --tty --rm --namespace <namespace> -- sh

This command runs the curlimages/curl docker image as a temporary pod named curl-debug, which is an open cURL docker image.

  • kubectl run curl-debug: Creates a pod named “curl-debug”
  • --image=curlimages/curl: Uses the curlimages/curl container image
  • -i --tty: Allocates an interactive terminal session
  • --rm: Automatically removes the pod when you exit the shell
  • --namespace <namespace>: Runs the pod in the specified namespace
  • -- sh: Executes the shell command after starting the container