-
Notifications
You must be signed in to change notification settings - Fork 0
/
onetimesettings.sh
executable file
·31 lines (27 loc) · 1.05 KB
/
onetimesettings.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# these came from various forums and troubleshooting I have done
# for example: https://github.com/teamserverless/k8s-on-raspbian/blob/master/GUIDE.md
echo disabling swap...
dphys-swapfile swapoff && sudo dphys-swapfile uninstall && sudo update-rc.d dphys-swapfile remove
systemctl disable dphys-swapfile
echo Adding "cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory" to /boot/cmdline.txt...
cp /boot/cmdline.txt /boot/cmdline_backup.txt
orig="$(head -n1 /boot/cmdline.txt) cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory"
echo $orig | sudo tee /boot/cmdline.txt
echo fixing docker driver...
mkdir -p /etc/docker
touch /etc/docker/daemon.json
echo '{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}' > /etc/docker/daemon.json
echo adding container networking plugins to weave path...
mkdir -p /opt/cni/bin
ln -s /usr/lib/cni/* /opt/cni/bin
echo enabling docker and kubelet..
systemctl daemon-reload
systemctl enable docker
systemctl enable kubelet