Skip to content

Instantly share code, notes, and snippets.

@RagedUnicorn
Last active July 25, 2018 17:08
Show Gist options
  • Save RagedUnicorn/451573f5bfe470e70413eee718e72c04 to your computer and use it in GitHub Desktop.
Save RagedUnicorn/451573f5bfe470e70413eee718e72c04 to your computer and use it in GitHub Desktop.
Operate kubernetes on ubuntu

Kubernetes Ubuntu Operate

Init Kubernetes

Initialize Kubernetes with kubeadm

sudo kubeadm init --apiserver-advertise-address=[private-address-of-the-master] --pod-network-cidr=10.244.0.0/16

Note: The used cidr is supported by flannel and should only be changed if you know what you are doing

Copy kubernetes configuration and make it accessible to ubuntu user

sudo cp /etc/kubernetes/admin.conf ~/
sudo chown ubuntu:ubuntu ~/admin.conf

export KUBECONFIG=~/admin.conf

Apply kubernetes pod network driver

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml

Afterwards the master node should be in status ready

kubectl get nodes

Reset Kubernetes

Kubernets can be reset with kubeadm. Note that you will have to repeat all of the above steps afterwards.

sudo kubeadm reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment