Running Kubernetes locally with non-administrative privileges and missing kubernetes config file

8/29/2018

I am learning Kubernetes with Docker to launch a simple Python web application. I am new to all the above technologies.

Below is the approach I was planning on:

  1. Install Kubernetes.
  2. Have a cluster up and running locally.
  3. Install Docker.
  4. Create Python Application

I successfully installed Kubectl on my local using Chocolatey following instructions from https://kubernetes.io/docs/tasks/tools/install-kubectl/.

I created .\kube directory in C:\Users directory. But I do not see any config files neither in the location where kubernetes has been installed C:\ProgramData\Chocolatey\lib\kubernetes-cli\tools\kubernetes\client\bin nor in C:\Users\User1\.kube directory.

When I run the command ".\kubectl cluster-info" in powershell against C:\ProgramData\Chocolatey\lib\kubernetes-cli\tools\kubernetes\client\bin
I get "Kubernetes master is running at http://localhost:8080" response. But when I run the same command against C:\Users\User1.kube I get

.\kubectl : The term '.\kubectl' is not recognized as the name of a cmdle or if a path was included, verify that the path is correct and try again.

Am I doing it the wrong way or missing anything here?

This blog says https://blog.tekspace.io/install-kubernetes-cli-on-windows-10/ "copy config file from Kubernetes master node to .kube folder" but I dont see any config file!

Appreciate your help.

-- Swetha Reddy
cluster-computing
kubernetes

1 Answer

8/29/2018

The blog you refer illustrates how to configure the CLI (Command Line Interface) on your Win10 computer, so that you can connect to a Kubernetes cluster.

The cluster is running on others machines. In the following picture you see a simplified schema.

enter image description here You connect to the master through a CLI (kubectl), the master receives your commands and acts on the nodes.

I suggest to copy kubectl.exe into folder C:\WINDOWS\system32 (which is in the PATH variable) so that you can type kubectl from whatever folder you are.

The config file the blog speaks about is on the Kubernetes master. It's not in your local machine. If you manage the machine on which the kube master runs, you need to connect (probably via SSH) and get the file (in /etc/kubernetes/ - admin.conf or kubernetes.conf, it depends on the installation, I followed this).

-- Nicola Ben
Source: StackOverflow