Kubernetes
    Kubernetes - Overview
    Kubernetes - Objects
    Kubernetes - API Extensions
    Kubernetes - apimachinery
    Kubernetes - Container Runtimes (CRI)
    Kubernetes - Storage (CSI)
    Kubernetes - Networking (CNI)
    Kubernetes - Ecosystem
    Kubernetes - Tools
    Kubernetes - kubectl
    Kubernetes - client-go
    Kubernetes - Source Code
    Kubernetes - Kind
    Kubernetes - kubeconfig
    Kubernetes - Versus

Kubernetes - kubeconfig

Updated: 2022-08-14

Config

TL;DR: config defines clusters and users.

To check the current config:

$ kubectl config view

A config has multiple contexts.

Context

TL;DR: context = a cluster + a user + a namespace (Each of the three is optional)

A context in Kubernetes is a group of access parameters. Each context contains a Kubernetes cluster, a user, and a namespace. The current context is the cluster that is currently the default for kubectl: all kubectl commands run against that cluster. Each of the context that have been used will be available on your .kubeconfig.

A context is the connection to a specific cluster (username/apiserver host) used by kubectl.

"Context" only applies in the kubernetes client-side (where you run the kubectl command); kubernetes server-side doesn't recognize the term 'context'.

# Show current context
$ kubectl config current-context

# Get all contexts
$ kubectl config get-contexts