kubernetes: kubectl in-cluster mode conflicts with --request-timeout
/kind bug
What happened:
From a container running inside of a cluster:
# kubectl get po --request-timeout=11s
The connection to the server localhost:8080 was refused - did you specify the right host or port?
What you expected to happen:
# kubectl get po --request-timeout=11s
...long list of pods here...
How to reproduce it (as minimally and precisely as possible):
- Run a container with kubectl installed (I used an Ubuntu container)
kubectl get po
<- this workskubectl get po --request-timeout=11s
<- this fails
Anything else we need to know?:
Looking through the logs -v=8, it looks like --request-timeout bypasses the part where it realizes that in-cluster mode is enabled.
Environment:
- Kubernetes version (use
kubectl version
): I tested v.1.6.3 through v1.7.1 - Cloud provider or hardware configuration**: Parallels hypervisor
- OS (e.g. from /etc/os-release):
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
- Kernel (e.g.
uname -a
): Linux ubuntu 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux - Install tools: kubeadm
- Others:
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 3
- Comments: 42 (18 by maintainers)
Commits related to this issue
- fix kubectl --as --as-group --request-timeout inside pods Fixes: https://github.com/kubernetes/kubernetes/issues/49622 https://github.com/kubernetes/kubernetes/issues/49343 — committed to CaoShuFeng/kubernetes by CaoShuFeng 7 years ago
- fix kubectl --as --as-group --request-timeout inside pods Fixes: https://github.com/kubernetes/kubernetes/issues/49622 https://github.com/kubernetes/kubernetes/issues/49343 — committed to CaoShuFeng/kubernetes by CaoShuFeng 7 years ago
- fix kubectl --as --as-group --request-timeout inside pods Fixes: https://github.com/kubernetes/kubernetes/issues/49622 https://github.com/kubernetes/kubernetes/issues/49343 — committed to CaoShuFeng/kubernetes by CaoShuFeng 7 years ago
- fix kubectl --as --as-group --request-timeout inside pods Fixes: https://github.com/kubernetes/kubernetes/issues/49622 https://github.com/kubernetes/kubernetes/issues/49343 — committed to CaoShuFeng/kubernetes by CaoShuFeng 7 years ago
/assign
/reopen
This is still broken in 1.18.4
In a cluster, on a pod, I can issue
kubectl get pods
without trouble but if it includes--request-timeout
it instantly fails:Still an issue on kubectl 1.13.8
/reopen /remove-lifecycle rotten /lifecycle frozen
/reopen
This is a rather concerning issue as we ran into an issue where kubectl hung due to one of the masters not responding and thus we did not get some other operation to continue after the fact. We started to add --request-timeout but that does not work on nodes (as per above)
The current only work-around is to wrapper everything with yet another process to timeout the kubectl commands.