How does Kubectl connect to the master

10/31/2015

I've installed Kubernetes via Vagrant on OS X and everything seems to be working fine, but I'm unsure how kubectl is able to communicate with the master node despite being local to the workstation filesystem.

How is this implemented?

-- user2487621
kubernetes

2 Answers

10/31/2015

kubectl has a configuration file that specifies the location of the Kubernetes apiserver and the client credentials to authenticate to the master. All of the commands issued by kubectl are over the HTTPS connection to the apiserver.

When you run the scripts to bring up a cluster, they typically generate this local configuration file with the parameters necessary to access the cluster you just created. By default, the file is located at ~/.kube/config.

-- Robert Bailey
Source: StackOverflow

10/31/2015

In addition to what Robert said: the connection between your local CLI and the cluster is controlled through kubectl config set, see the docs.

The Getting started with Vagrant section of the docs should contain everything you need.

-- Michael Hausenblas
Source: StackOverflow