I'm using minikube to test the kompose. I installed k8s using the following minikube command
# 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/
and 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"}
But when I use the kompose up
command, it shows 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
Querying the kubectl configuration found that its port was 8443
, different from the 6443
connected by 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'.
I think that's the problem, but I don't know how to fix it to make the ports match
, right.
I would appreciate it if you could tell me how to solve it?
You add this flag in the start command
--apiserver-port=6443