Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.61 KB

File metadata and controls

66 lines (45 loc) · 1.61 KB

KubeConfig

In this section, we will take a look at kubeconfig in kubernetes

Client uses the certificate file and key to query the kubernetes Rest API for a list of pods using curl.

  • You can specify the same using kubectl

    kc1

  • We can move these information to a configuration file called kubeconfig. And the specify this file as the kubeconfig option in the command.

    $ kubectl get pods --kubeconfig config
    

Kubeconfig File

  • The kubeconfig file has 3 sections

    • Clusters
    • Contexts
    • USers

    kc4

    kc5

  • To view the current file being used

    $ kubectl config view
    
  • You can specify the kubeconfig file with kubectl config view with "--kubeconfig" flag

    $ kubectl config veiw --kubeconfig=my-custom-config
    

    kc6

  • How do you update your current context? Or change the current context

    $ kubectl config view --kubeconfig=my-custom-config
    

    kc7

  • kubectl config help

    $ kubectl config -h
    

    kc8

What about namespaces?

kc9

Certificates in kubeconfig

kc10

kc12

kc11

K8s Reference Docs