Files
Kubernetes/使用文档/使用Kubectl-Proxy访问Pod.md
offends 89a07bc062
All checks were successful
continuous-integration/drone Build is passing
first commit
2025-12-20 21:10:05 +08:00

565 B

本文作者:丁辉

使用Kubectl-Proxy访问Pod

官方文档

  1. 开启代理

    kubectl proxy
    
  2. 验证

    curl http://localhost:8001/version
    
  3. 通过代理的 API 访问 Pod

    • 更换 $NAMESPACES 为所需访问的命名空间
    • 更换 $POD_NAME 为所需访问的容器名
    curl http://localhost:8001/api/v1/namespaces/$NAMESPACES/pods/$POD_NAME:80/proxy/