Skip to content

Latest commit

 

History

History
executable file
·
67 lines (45 loc) · 1.57 KB

File metadata and controls

executable file
·
67 lines (45 loc) · 1.57 KB

KubeConfig

In this section, we will take a look at KubeConfig.

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 this information to a configuration file called kubeconfig. And then 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