Last active
December 8, 2019 05:45
-
-
Save Prodian0013/e5c4a6883bce042dc8bb06f1217c53a7 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