Concept and usage
Thekubeconfig file configures access to Kubernetes clusters by specifying cluster, user, and context information. Without it, you must supply authentication details on every kubectl command:
Methods
- kubeconfig flag (not recommended)
- kubeconfig file (recommended)
Create a plain-text config file:Then reference it on every command:This is not recommended because you must specify the config file on every command.
config
Viewing and switching contexts
config
Setting a default kubeconfig file
Using base64-encoded certificate data
Instead of pointing to a certificate file withcertificate-authority, you can embed the certificate data directly as base64:
config