How kubectl communicate with API server?

Workstation
– kubectl
read a file from 2 Location
~/.kube/config && KUBECONFIG (env var)

What is content of this “config” file?
– ITS YAML
Contains

	Clustor(S):
		Clustor1: http://of API Server
		Clustor2: http://of API Server
		Clustor3: http://of API Server
	USER(S):
		user1: cert+key
		user2: cert+key
		user3: cert+key
	Context(s)
		Context1 - Clustor1 + user3 
		Context2 - Clustor2 + user1
		Context3 - Clustor3 + user2
	Default context = Context2
  current-context Displays the current-context
  delete-cluster  Delete the specified cluster from the kubeconfig
  delete-context  Delete the specified context from the kubeconfig
  delete-user     Delete the specified user from the kubeconfig
  get-clusters    Display clusters defined in the kubeconfig
  get-contexts    Describe one or many contexts
  get-users       Display users defined in the kubeconfig
  rename-context  Renames a context from the kubeconfig file.
  set             Sets an individual value in a kubeconfig file
  set-cluster     Sets a cluster entry in kubeconfig
  set-context     Sets a context entry in kubeconfig
  set-credentials Sets a user entry in kubeconfig
  unset           Unsets an individual value in a kubeconfig file
  use-context     Sets the current-context in a kubeconfig file
  view            Display merged kubeconfig settings or a specified kubeconfig file

kubectl config current-context
kubectl config get-clusters
kubectl config get-contexts
kubectl config get-users
kubectl config view
Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)