n-Arno / vagrant-alpine-k3s

K3S in an alpine with Vagrant
2 stars 2 forks source link

Error while installing Dashboard #2

Open purplemana opened 5 years ago

purplemana commented 5 years ago

Hi, I was able to run the vagrant box on Windows. To install Kubernetes Dashboard, I connected to the running box using ssh and used the below command:

    kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml

And got the below errrors:

    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused
    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused
    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused
    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused
    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused
    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused
    unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 10.0.2.15:8080: connect: connection refused

My guess is that the base alpine is not able to dns resolve this address. Being a novice with Alpine and Vagrant, I'd appreciate if you can suggest a way forward.

Thanks.

purplemana commented 5 years ago

So its not a DNS issue as ping is successful to the remote address. It's something else with the image.

purplemana commented 5 years ago

On further investigation, k3s was crashed. I tried upgrading the downloaded k3s version mentioned in Vagrantfile to 0.2.0. But it still crashed.

Here's the server.log tail:

vagrant:/var/log/k3s$ sudo tail -f server.log
time="2019-03-22T02:16:23.787070835-07:00" level=info msg="Running kube-scheduler --kubeconfig /var/lib/rancher/k3s/server/cred/kubeconfig-system.yaml --port 10251 --address 127.0.0.1 --secure-port 0 --leader-elect=false"
time="2019-03-22T02:16:23.800507294-07:00" level=info msg="Running kube-controller-manager --kubeconfig /var/lib/rancher/k3s/server/cred/kubeconfig-system.yaml --service-account-private-key-file /var/lib/rancher/k3s/server/tls/service.key --allocate-node-cidrs --cluster-cidr 10.42.0.0/16 --root-ca-file /var/lib/rancher/k3s/server/tls/token-ca.crt --port 10252 --address 127.0.0.1 --secure-port 0 --leader-elect=false"
Flag --address has been deprecated, see --bind-address instead.
panic: creating CRD store Get https://localhost:6444/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions: dial tcp 10.0.2.15:6444: connect: connection refused

goroutine 231 [running]:
github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd.(*Factory).BatchCreateCRDs.func1(0xc0013364e0, 0xc0016457a0, 0x3, 0x3, 0xc0017975e0, 0x55db780, 0x35d4760, 0xc001645920, 0x0, 0x0)
        /go/src/github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd/init.go:65 +0x2d9
created by github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd.(*Factory).BatchCreateCRDs
        /go/src/github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd/init.go:50 +0xce