Skip to content

Commit

Permalink
feat: Install yq in Vagrantfile and containerd config.toml update in …
Browse files Browse the repository at this point in the history
…install.sh
  • Loading branch information
hi120ki committed Aug 10, 2023
1 parent ffc1951 commit 6d5239c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Vagrant.configure("2") do |config|
config.vbguest.auto_update = false
end
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo snap install yq
bash -eu /vagrant/install.sh 192.168.56.210
SHELL
end
12 changes: 5 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if [ $# -ne 1 ]; then
exit 1
fi

sudo snap install yq

echo "[i] install helm"
cd ~
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
Expand All @@ -24,6 +26,7 @@ if [ -f ~/.config/fish/config.fish ]; then
echo 'test -f ~/.kubectl_aliases.fish && source ~/.kubectl_aliases.fish' >>~/.config/fish/config.fish
fi

# https://kubernetes.io/docs/setup/production-environment/container-runtimes/#install-and-configure-prerequisites
echo "[i] network config"
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
Expand All @@ -40,12 +43,7 @@ net.ipv4.ip_forward = 1
EOF

sudo sysctl --system

sudo apt-get update && sudo apt-get install -y iptables arptables ebtables
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
sudo update-alternatives --set arptables /usr/sbin/arptables-legacy
sudo update-alternatives --set ebtables /usr/sbin/ebtables-legacy
sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward

echo "[i] install containerd"
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
Expand All @@ -56,7 +54,7 @@ sudo add-apt-repository \
stable"
sudo apt-get update && sudo apt-get install -y containerd.io
sudo mkdir -p /etc/containerd
containerd config default | sed -e "s/systemd_cgroup = false/systemd_cgroup = true/g" | sudo tee /etc/containerd/config.toml
containerd config default | sed -e "s/SystemdCgroup = false/SystemdCgroup = true/g" | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd

echo "[i] install kubeadm"
Expand Down

0 comments on commit 6d5239c

Please sign in to comment.