NOMAD Vis Kubernetes Install


Kubernetes is central to NOMAD archive and analytics (see /nomad/Kubernetes).

Every installation of kubernetes has been quite different (kubernetes evolves quickly). Here is the description of the latest (more manual) installation I did on CentOS for the remote visualization, mainly as a reference for me. This uses kubeadm something that has simplified the installation of kubernetes.

update kubeadm


cat <<EOF > /etc/yum.repos.d/kubernetes.repo

# Set SELinux in permissive mode (effectively disabling it)
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

systemctl enable kubelet && systemctl start kubelet

The following changes to sysctl were not needed (already performed)

if ! sysctl --system | grep "net.bridge.bridge-nf-call-ip6tables = 1" > /dev/null ; then
   cat <<EOF >  /etc/sysctl.d/90-k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
sysctl --system

cleanup old version

    kubectl drain <node> --delete-local-data --force --ignore-daemonsets

    kubeadm reset

reinstall (with flannel, weave seems to officially support only 1.10?)

    kubeadm init --pod-network-cidr=

Save join command printed by the command above to /etc/kubernetes/join.cmd to be able to join other nodes

get & install flannel

    curl > kube-flannel.yml
    kubectl create -f kube-flannel.yml

fix coredns on older docker/SElinux versions

This is the issue I did hit this time: the dns would not start up. As discussed in kubeadm issue 998 this is caused by a bug in older docker/SElinux. One could disable SElinux, or upgrade docker, but these weren’t options for us, so

    kubectl -n kube-system edit deploy coredns
    # remove "allowPrivilegeEscalation: false"

allow pods on master node

This installation was a single node install, so allow pods on master node:

   kubectl taint nodes --all

Leave a comment

Comments are moderated. Your email address is neither published nor stored, only an md5 hash of it. Required fields are marked with *