Как изменить настройку параметров запуска мини-куба с 8443 до 6443 - PullRequest
0 голосов
/ 14 апреля 2020

Я использую миникуб для проверки компоса. Я установил k8s с помощью следующей команды minikube

# minikube start --driver=none --kubernetes-version v1.16.0
minikube v1.9.2 on Ubuntu 18.04
✨  Using the none driver based on user configuration
?  Starting control plane node  in cluster minikube
?  Running on localhost (CPUs=XX, Memory=XXXXXMB, Disk=XXXXXMB) ...
ℹ️  OS release is Ubuntu 18.04.3 LTS
?  Preparing Kubernetes v1.16.0 on Docker 18.09.7 ...
    ▪ kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
❗  This bare metal machine is having trouble accessing https://k8s.gcr.io
?  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
?  Enabling addons: default-storageclass, storage-provisioner
?  Configuring local host environment ...

❗  The 'none' driver is designed for experts who need to integrate with an existing VM
?  Most users should use the newer 'docker' driver instead, which does not require root!
?  For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/

❗  kubectl and minikube configuration will be stored in /root
❗  To use kubectl or minikube commands as your own user, you may need to relocate them. For example, to overwrite your own settings, run:

    ▪ sudo mv /root/.kube /root/.minikube $HOME
    ▪ sudo chown -R $USER $HOME/.kube $HOME/.minikube

?  This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
?  Done! kubectl is now configured to use "minikube"
?  For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/

и curl, chmod, mv install kubectl

# kubectl versionClient Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

Но когда я использую команду kompose up, она показывает connection rejection

kompose -f docker-compose.yaml up
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. 

FATA Error while deploying application: Get https://127.0.0.1:6443/api: dial tcp 127.0.0.1:6443: connect: connection refused

При запросе конфигурации kubectl обнаружил, что его порт 8443, отличается от 6443, подключенного kompose up

# kubectl cluster-info
Kubernetes master is running at https://172.26.90.122:8443
KubeDNS is running at https://172.26.90.122:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Я думаю, что это проблема, но я не знаю, как fix it to make the ports match, верно.

Буду признателен, если вы подскажете мне, как ее решить?

1 Ответ

2 голосов
/ 14 апреля 2020

Вы добавляете этот флаг в команду запуска

--apiserver-port=6443 
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...