Skip to content

Commit

Permalink
Use systemd cgroups driver on CoreOS and enable kubelet by default (#541
Browse files Browse the repository at this point in the history
)

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
xmudrii authored and kubermatic-bot committed Jul 3, 2019
1 parent ae21bb7 commit 5fcb230
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkg/installer/installation/prerequisites.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sudo sed -i '/.*swap.*/d' /etc/fstab
source /etc/os-release
source /etc/kubeone/proxy-env
# Short-Circuit the installation if it was arleady executed
# Short-Circuit the installation if it was already executed
if type docker &>/dev/null && type kubelet &>/dev/null; then exit 0; fi
sudo mkdir -p /etc/docker
Expand Down Expand Up @@ -131,6 +131,7 @@ sudo apt-get install -y --no-install-recommends \
kubernetes-cni=${cni_ver}
sudo apt-mark hold docker-ce kubelet kubeadm kubectl kubernetes-cni
sudo systemctl enable --now docker
sudo systemctl enable --now kubelet
`

kubeadmCentOSScript = `
Expand All @@ -141,7 +142,7 @@ sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/sysconfig/selinux
source /etc/kubeone/proxy-env
# Short-Circuit the installation if it was arleady executed
# Short-Circuit the installation if it was already executed
if type docker &>/dev/null && type kubelet &>/dev/null; then exit 0; fi
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
Expand All @@ -167,11 +168,24 @@ sudo yum install -y --disableexcludes=kubernetes \
kubectl-{{ .KUBERNETES_VERSION }}-0 \
kubernetes-cni-{{ .CNI_VERSION }}-0
sudo systemctl enable --now docker
sudo systemctl enable --now kubelet
`

kubeadmCoreOSScript = `
source /etc/kubeone/proxy-env
# Short-Circuit the installation if it was already executed
if type docker &>/dev/null && type kubelet &>/dev/null; then exit 0; fi
sudo mkdir -p /etc/docker
cat <<EOF | sudo tee /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"storage-driver": "overlay2"
}
EOF
sudo systemctl restart docker
sudo mkdir -p /opt/cni/bin /etc/kubernetes/pki /etc/kubernetes/manifests
curl -L "https://github.com/containernetworking/plugins/releases/download/{{ .CNI_VERSION }}/cni-plugins-amd64-{{ .CNI_VERSION }}.tgz" | \
sudo tar -C /opt/cni/bin -xz
Expand Down

0 comments on commit 5fcb230

Please sign in to comment.