Interview Prep/Python for DevOps/boto3, HTTP & API errors

`requests` uploads work locally but fail in Kubernetes with `ProxyError: Unable to connect to proxy`.

AdvancedTroubleshootingboto3, HTTP & API errors
Answer

Likely causes → HTTPS_PROXY is set in the pod (inherited from a base image or cluster-wide injection) but the proxy is unreachable from this namespace, or NO_PROXY does not exclude internal hosts like *.svc.cluster.local and 169.254.169.254.

Diagnose →

kubectl exec <pod> -- env | grep -i proxy

Fix → Fix NO_PROXY (.svc,.cluster.local,10.0.0.0/8,169.254.169.254), or unset the proxy for in-cluster traffic; session.trust_env = False disables env proxies for a specific session.

Prevent → Standardize proxy variables at the platform level and test from a pod.

All Python for DevOps questions Roadmap: Python for automation

More on boto3, HTTP & API errors