certificate-authority-data
from kubeconfig fails for long-running process due to tmpfs cleanup
#1782
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
What happened (please include outputs or screenshots):
Long-running applications using a kubeconfig with
certificate-authority-data
encounter errors like:What you expected to happen:
Client should not expect tempfiles to live indefinitely. It is extremely common for servers to reap tempfiles.
Anything else we need to know?:
If you create a client you can easily see that it is using a temp file that cannot go away for the duration of the client:
You can reproduce the issue by deleting that temp file and attempting to make a request.
Code is here:
python/kubernetes/base/config/kube_config.py
Lines 63 to 78 in 1271465
In order for this to work reliably for long-running processes on standard linux systems, the temp file really needs to be created for each request rather than a single time at startup.
That said, on linux systems, a potential hack would be to use
/proc/self/fd/<fileno>
instead of the temfile path since that would share the lifecycle of the process.Environment:
python --version
): 3.6pip list | grep kubernetes
): 21.7.0The text was updated successfully, but these errors were encountered: