I am trying to install Kubernetes on Ubuntu 16.04 VM, I tried this https://kubernetes.io/docs/getting-started-guides/kubeadm/, but the API server does not start.
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Is there a good procedure on how to install Kubernetes on Ubuntu VM
In current version of kubeadm
(v1.6.1), insecure port of ApiServer is abandoned by default, you can verify this by checking api-server yaml file in /etc/kubernetes/manifests/kube-apiserver.yaml
, there is kube-apiserver parameter --insecure-port=0
.
You can
Correct this in a running cluster:
$ mv kube-apiserver.yaml ../kube-apiserver.yaml
// edit ../kube-apiserver.yaml to remove --insecure-port=0
// or change it to --insecure-port=<WHATERER_YOUR_LIKE>
$ mv ../kube-apiserver.yaml kube-apiserver.yaml
Do it right at startup. You need a kubeadm config file to do this. A simple one would like:
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
apiServerExtraArgs:
insecure-port: 8080 //or whatever you like
// Then you can start a master node use `kubeadm init --config=<this-configure-file-path>`
I was unable to set up kubernetes on Ubuntu VM on Windows host using Oracle VM VirtualBox. See https://www.virtualbox.org/ticket/4032.
I switched to VMWare Workstation 12 (free not Pro) to use Kubernetes. Taking backups has gotten more tedious as exporting to ovf is available only with Pro. Kubernetes works fine
You probably haven't set up the credentials for kubectl
.
sudo cp /etc/kubernetes/admin.conf $HOME/ && sudo chown $(id -u):$(id -g) $HOME/admin.conf; if ! fgrep -q KUBECONFIG= $HOME/.bashrc; then echo 'export KUBECONFIG=$HOME/admin.conf' >> $HOME/.bashrc; fi;. $HOME/.bashrc
It takes /etc/kubernetes/admin.conf
to the home directory and makes it readable by current user. Also adjusts .bashrc
to set the KUBECONFIG
environment variable to point to that admin.conf
.