Skip to content
No description or website provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Ondrej Sika ( |

Bare Metal Kubernetes

Ondrej Sika <>

About Course

Kubernetes Training

Related Repository

Any Questions?

Write me mail to

Install Docker

curl -fsSL | sudo sh

Install Kubernetes (kubeadm, kubectl)

curl -fsSL | sudo sh

Install NFS client (for NFS Persistant Volume Claims)

sudo apt install nfs-common

Create a Master

Kubernetes doesn't run if you have swap on. You can disable it using:

swapoff -a

Now you can setup master

kubeadm init --pod-network-cidr=

Configure kubect

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Join nodes

You can also disable swap, if it's on:

swapoff -a
kubeadm join <ip>:6443 --token <token> --discovery-token-ca-cert-hash <ca-hash>

Master only

If you want run cluster with just one server (master only), you have to allow to run containers on master, which is not recommended.

kubectl taint nodes --all

Install Flannel network

kubectl apply -f


kubectl apply -f kube-flannel.yml

Check Nodes

kubectl get nodes

Install Dashboard

kubectl apply -f


kubectl apply -f kubernetes-dashboard.yaml

Add Dashboard User

kubectl apply -f
kubectl apply -f dashboard-user.yml

Get Dashboard Token

kubectl -n kube-system describe serviceaccounts admin-user
kubectl -n kube-system describe secret <admin-user-token>

Or in one line

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t'

Run kubectl proxy

kubectl proxy

Open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

Create Traefik LoadBalancer (for Ingress)

I've prepared Ingress Controllet configuration, you can apply it by:

kubectl apply -f

or browse in own repository ondrejsika/kubernetes-ingress-traefik

Install Helm Client


Or oneliner for Linux:

curl | bash

Or on Windows:

choco install kubernetes-helm

Install NFS Client Provisioner (using Helm)

helm install nfs-client-provisioner stable/nfs-client-provisioner --set nfs.server=<nfs-server> --set nfs.path=<exported-path>

For example:

helm install nfs-client-provisioner stable/nfs-client-provisioner --set --set nfs.path=/nfs

Set nfs-client as Default Storage Class

kubectl patch storageclass nfs-client -p '{"metadata": {"annotations":{"":"true"}}}'
You can’t perform that action at this time.