v1.23.0
Fix: In-Cluster Kubernetes Config
Resolves the HTTPConnectionPool(host='localhost', port=80): Max retries exceeded error when the server is deployed inside a Kubernetes cluster (#61).
What Changed
- Fixed config loading —
_patched_load_kube_configno longer short-circuits calls with explicit arguments (config_file, context, client_configuration), which was preventing the kubernetes client from loading the correct API server address - In-cluster fallback — The kubeconfig provider now automatically falls back to in-cluster config when no kubeconfig file exists in the container
- Actionable errors — Raises
ProviderErrorwith clear remediation steps when neither kubeconfig nor in-cluster config is available, instead of silently falling back tolocalhost:80 - Deployment manifest — Added
MCP_K8S_PROVIDER=in-clusterandKUBERNETES_SERVICE_PORT=443env vars
Deployment
For in-cluster deployments, ensure these env vars are set:
env:
- name: MCP_K8S_PROVIDER
value: "in-cluster"
- name: KUBERNETES_SERVICE_HOST
value: "kubernetes.default.svc"
- name: KUBERNETES_SERVICE_PORT
value: "443"Reference manifests: deploy/kubernetes/
Install
pip install kubectl-mcp-server==1.23.0
# or
npx kubectl-mcp-server@1.23.0
# or
docker pull rohitghumare64/kubectl-mcp-server:1.23.0