How Do You Get Kubernetes to Work as a Test Instance?

Problem scenario
You want to set up Kubernetes on a server as quickly as possible as a proof-of-concept.  You want to create pods without the best practice security mechanisms because you are behind a firewall and in a development environment.  How do you quickly install and configure Kubernetes as a development deployment on a single host server?

Solution
1.  Install and configure kubelet, kubeadm, kubectl, etcd, kube-proxy, kube-controller-manager, and kube-scheduler.  To do these things on Ubuntu see this link for the first four and this link for the last three.

2.  Run these six commands:

cd ~
mkdir etcd-data
docker run --volume=$PWD/etcd-data:/default.etcd --detach --net=host quay.io/coreos/etcd > etcd-container-id
sudo wget https://storage.googleapis.com/kubernetes-release/release/v1.0.7/bin/linux/amd64/kube-apiserver
sudo chmod +x kube-apiserver
sudo kube-apiserver --etcd-servers=http://127.0.0.1:2379 --service-cluster-ip-range=10.0.0.0/16 --secure-port=0

3.  Create or open a duplicate terminal session.  Run your kubectl commands as you please.

Leave a comment

Your email address will not be published.