kubectl keeps .kube in non-standard place.

What happened:
kubectl utility does not keep it's configuration in the standard location on Linux as defined by the freedesktop. See: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
The spec was created in order to manage large number of configuration areas that turned unmanageable in the old days. Using the spec will allow for much better predictability especially when it comes to automation.

What you expected to happen:
Per the spec, the kubectl should create a directory in .local/kube/configuration
this snippet from the spec:
" $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used. "

How to reproduce it (as minimally and precisely as possible):

Running kubectl for the first time will create the directory and default configuration.

Anything else we need to know?:

This might seem pedantic but it is not a no-mans land out in the Linux platform and we do create standards for utilities to adhere to so that we have a consistency. It is reasonably expected that orgs, communities, and people should adhere to them.

Understandably, it could break scripts so I realize that this change could be burdensome given people's reliance on a well known location.

I only ask that you consider this and the k8s community adhere to community standards that were built for this platform over the past two decades.

I'm happy to answer questions in regards to this.

Environment: N/A

  • Kubernetes client and server versions (use kubectl version): N/A
  • Cloud provider or hardware configuration: N/A
  • OS (e.g: cat /etc/os-release): All Linux distributions.