Configuring kubectl on remote clusters

I followed Kubernetes docs to configure a single node cluster as a Docker container . Now I have Kubernetes running on a remote Linux VM (say mykube01.example.com).

Then I downloaded and installed kubectllocally on my Mac laptop. I can run kubectl version, and it checks that I installed the correct version.

Then I decided to configure kubectlon after this document and created the following ~/.kube/configfile:

 apiVersion: v1
 clusters:
 - cluster:
      api-version: v1
      server: http://mykube01.example.com:8080
      name: testkube

When I run kubectl cluster-info, I get:

Kubernetes master is running at http://mykuber01.example.com:8080

But when I run kubetctl get nodes, I get:

The connection to the server mykube01.example.com:8080 was refused - did you specify the right host or port?

, ? , Kubernetes nginx 1- node, :

kubectl -s http://mykube01.example.com:8080 run-container nginx --image=nginx --port=80

, kubectl "".

+4
2

( "" "", ""

kubectl HTTP (S) . , "curl mykube01.example.com:8080/api/v1/nodes" URL , .

, kubectl , kubectl . , -.

+1

, :

/etc/kubernetes/kubelet.conf

. , kubelet.conf ~/.kube/config. .

+1

Source: https://habr.com/ru/post/1609042/


All Articles