-
-
Save nhtzr/dd61d83b9633e5978ba4b911238d633e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat <<EOF > /etc/cni/net.d/100-crio-flannel.conf | |
{ | |
"cniVersion": "0.3.0", | |
"name": "mynet", | |
"type": "flannel" | |
} | |
EOF | |
cat <<EOF > /etc/cni/net.d/200-loopback.conf | |
{ | |
"cniVersion": "0.3.0", | |
"type": "loopback" | |
} | |
EOF | |
# Switch cgroup manager to cgroupfs and logging to debug | |
sed -i 's|cgroup_manager = "systemd"|cgroup_manager = "cgroupfs"|g' /etc/crio/crio.conf | |
sed -i 's|log_level = "error"|log_level = "debug"|g' /etc/crio/crio.conf | |
systemctl enable crio | |
systemctl start crio | |
# Update kubelet extra args | |
echo "KUBELET_EXTRA_ARGS=--cgroup-driver=cgroupfs --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice" > /etc/sysconfig/kubelet | |
systemctl daemon-reload | |
systemctl enable kubelet | |
systemctl start kubelet | |
kubeadm init --pod-network-cidr=10.244.0.0/16 --kubernetes-version=1.15.2 | |
mkdir /root/.kube | |
cp /etc/kubernetes/admin.conf /root/.kube/config | |
curl -o /root/kube-flannel.yml https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml | |
kubectl create -f /root/kube-flannel.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment