kubectl не может обнаружить локальный хост: 8080 с локальным миникубом - PullRequest
0 голосов
/ 01 мая 2019

Я пытаюсь запустить учебник на https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive/ локально на машине ubuntu 18.

$ minikube start
    ?  minikube v1.0.1 on linux (amd64)
    ?  Downloading Kubernetes v1.14.1 images in the background ...
    ?  Creating kvm2 VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
    ?  "minikube" IP address is 192.168.39.247
    ?  Configuring Docker as the container runtime ...
    ?  Version of container runtime is 18.06.3-ce
    ⌛  Waiting for image downloads to complete ...
    ✨  Preparing Kubernetes environment ...
    ?  Downloading kubeadm v1.14.1
    ?  Downloading kubelet v1.14.1
    ?  Pulling images required by Kubernetes v1.14.1 ...
    ?  Launching Kubernetes v1.14.1 using kubeadm ... 
    ⌛  Waiting for pods: apiserver proxy etcd scheduler controller dns
    ?  Configuring cluster permissions ...
    ?  Verifying component health .....
    ?  kubectl is now configured to use "minikube"
    ?  Done! Thank you for using minikube!

Пока все хорошо. Далее я пытаюсь запустить

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?

Аналогичный ответ для

$ kubectl cluster-info

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server localhost:8080 was refused - did you specify the right host or port?

Как и

$ kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?

Что мне не хватает?

1 Ответ

0 голосов
/ 01 мая 2019

Хорошо, поэтому я смог найти ответ сам.

~ / .kube / config присутствовал ранее, поэтому я сначала удалил его.

Затем, когда я снова запустил команды, файл конфигурации снова был создан, и в нем указан порт 8443.

Итак, перед запуском minikube необходимо убедиться, что старый ~ / .kube / config файл отсутствует.

...