Skip to content

Instantly share code, notes, and snippets.

@sfxworks
Last active October 11, 2021 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfxworks/ba813aa1dd464228abadafaeb583c7ff to your computer and use it in GitHub Desktop.
Save sfxworks/ba813aa1dd464228abadafaeb583c7ff to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
apt-get update -y && apt-get upgrade -y
cat <<EOF | tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
apt-get install -y apt-transport-https curl ipset ipvsadm lvm2 gpg containerd
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list
apt-get update -y
apt-get install -y kubelet kubeadm kubectl
echo "br_netfilter" > /etc/modules
echo '1' > /proc/sys/net/ipv4/ip_forward
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
#mkdir -p /root/.ssh
#curl https://github.com/$GH_USERNAME.keys > /root/.ssh/authorized_keys
sed -i '/ swap / s/^/#/' /etc/fstab
echo -n " cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1" >> /boot/firmware/cmdline.txt
@mazzystr
Copy link

That should be a sed append. The echo -n is adding options to a newline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment