-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add installation scripts for k8s, correct PI installation (#27)
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# Install kubelet, kubeadm, kubectl, and cri-o on Ubuntu 22.04+ | ||
# Source: https://github.com/cri-o/packaging/blob/main/README.md#usage | ||
|
||
KUBERNETES_VERSION=v1.31 | ||
CRIO_VERSION=v1.30 | ||
|
||
sudo apt-get update | ||
# apt-transport-https may be a dummy package; if so, you can skip that package | ||
sudo apt-get install -y software-properties-common apt-transport-https ca-certificates curl gpg | ||
|
||
# If the directory `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below. | ||
sudo mkdir -p -m 755 /etc/apt/keyrings | ||
|
||
curl -fsSL https://pkgs.k8s.io/core:/stable:/$KUBERNETES_VERSION/deb/Release.key | | ||
sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg | ||
|
||
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/$KUBERNETES_VERSION/deb/ /" | | ||
sudo tee /etc/apt/sources.list.d/kubernetes.list | ||
|
||
curl -fsSL https://pkgs.k8s.io/addons:/cri-o:/stable:/$CRIO_VERSION/deb/Release.key | | ||
sudo gpg --dearmor -o /etc/apt/keyrings/cri-o-apt-keyring.gpg | ||
|
||
echo "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://pkgs.k8s.io/addons:/cri-o:/stable:/$CRIO_VERSION/deb/ /" | | ||
sudo tee /etc/apt/sources.list.d/cri-o.list | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y cri-o kubelet kubeadm kubectl | ||
sudo apt-mark hold kubelet kubeadm kubectl | ||
|
||
sudo systemctl enable --now kubelet | ||
sudo systemctl start crio.service | ||
|
||
# Swap should be disabled and br_netfilter should be loaded, | ||
# and net.ipv4.ip_forward should be enabled, | ||
# otherwise, kubeadm init will fail when starting kubelet. | ||
# sudo swapoff -a | ||
# sudo modprobe br_netfilter | ||
# sudo sysctl -w net.ipv4.ip_forward=1 |
This file contains 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