Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Setup Kubernetes on Ubuntu 16.04

$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https
$ sudo curl -s | sudo apt-key add -
$ sudo echo "deb kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update -y
$ sudo apt install
$ sudo apt-get install -y kubelet kubeadm kubernetes-cni
$ cat /proc/swaps
$ swapoff
$ kubeadm init --pod-network-cidr= --apiserver-advertise-address=
$ sudo useradd kube -G sudo -m
$ sudo passwd kube
$ sudo su - kube
$ sudo cp /etc/kubernetes/admin.conf $HOME/
$ sudo chown $(id -u):$(id -g) $HOME/admin.conf
$ export KUBECONFIG=$HOME/admin.conf
$ echo "export KUBECONFIG=$HOME/admin.conf" | tee -a ~/.bashrc

Check pods status, wait until all running

$ su - kube -c kubectl get pods --all-namespaces
$ kubectl apply -f
$ kubectl apply -f

# or

$ kubectl apply -f
$ kubectl taint nodes --all
$ kubectl apply -f

Create dashboard user


apiVersion: v1
kind: ServiceAccount
  name: admin-user
  namespace: kube-system


kind: ClusterRoleBinding
  name: admin-user
  kind: ClusterRole
  name: cluster-admin
- kind: ServiceAccount
  name: admin-user
  namespace: kube-system
$ kubectl create -f create-user.yml
$ kubectl create -f create-role.yml
$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')

References :


The post Setup Kubernetes on Ubuntu 16.04 appeared first on Python in the jungle.

This post first appeared on Pulpn - Cool News Directories, please read the originial post: here

Share the post

Setup Kubernetes on Ubuntu 16.04


Subscribe to Pulpn - Cool News Directories

Get updates delivered right to your inbox!

Thank you for your subscription