KubeConfig Download Fails With a Timeout Error

Problem

A timeout error is observed when kubeconfig download is requested from the UI.

mceclip0.png

The following error is observed in the /var/log/pf9/sidekick.log on the active master node.

[2021-04-12 21:27:05.766] [DEBUG] client - 'sudo /opt/pf9/pf9-kube/make_kubeconfig.sh "admin@platform9.net" "london" 6585ad01-7bdc-489e-818d-81b23f8eb812' matches: ^sudo /opt/pf9/pf9-kube/make_kubeconfig.sh \S+ \S+ \S+$[2021-04-12 21:27:06.141] [INFO] client - command status: 255 stdout: Writing kubeconfig for user admin@platform9.net to /tmp/kubeconfig.xhAcstderr: I0412 21:27:06.129154 10328 loader.go:375] Config loaded from file: /tmp/kubeconfig.xhAcF0412 21:27:06.134214 10328 helpers.go:115] error: open /opt/pf9/home/.kube/config.lock: file exists

Environment

  • Platform9 Managed Kubernetes - All versions

Cause

When a kubeconfig for a cluster is requested from the UI. kubeconfig generation fails due to a file lock from a previously failed config generation.

Resolution

  1. SSH to the active master node where you see the above error in the sidekick log.

  2. Check for a stale config.lock file under /opt/pf9/home/.kube directory.

# cd /opt/pf9/home/.kube/# lscache config.lock http-cache
  1. Deleted the config.lock file and request a new kubeconfig file.

# rm config.lock