sin sudo
This commit is contained in:
26
k8s.sh
26
k8s.sh
@@ -1,40 +1,40 @@
|
|||||||
# Enable kernel modules
|
# Enable kernel modules
|
||||||
sudo modprobe overlay
|
modprobe overlay
|
||||||
sudo modprobe br_netfilter
|
modprobe br_netfilter
|
||||||
|
|
||||||
# Add some settings to sysctl
|
# Add some settings to sysctl
|
||||||
sudo tee /etc/sysctl.d/kubernetes.conf<<EOF
|
tee /etc/sysctl.d/kubernetes.conf<<EOF
|
||||||
net.bridge.bridge-nf-call-ip6tables = 1
|
net.bridge.bridge-nf-call-ip6tables = 1
|
||||||
net.bridge.bridge-nf-call-iptables = 1
|
net.bridge.bridge-nf-call-iptables = 1
|
||||||
net.ipv4.ip_forward = 1
|
net.ipv4.ip_forward = 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Reload sysctl
|
# Reload sysctl
|
||||||
sudo sysctl --system
|
sysctl --system
|
||||||
|
|
||||||
# Configure persistent loading of modules
|
# Configure persistent loading of modules
|
||||||
sudo tee /etc/modules-load.d/containerd.conf <<EOF
|
tee /etc/modules-load.d/containerd.conf <<EOF
|
||||||
overlay
|
overlay
|
||||||
br_netfilter
|
br_netfilter
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Install required packages
|
# Install required packages
|
||||||
sudo apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates
|
apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates
|
||||||
|
|
||||||
# Add Docker repo
|
# Add Docker repo
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
|
||||||
|
|
||||||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
|
|
||||||
# Install containerd
|
# Install containerd
|
||||||
sudo apt update
|
apt update
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt install -y containerd.io
|
DEBIAN_FRONTEND=noninteractive apt install -y containerd.io
|
||||||
|
|
||||||
# Configure containerd and start service
|
# Configure containerd and start service
|
||||||
sudo mkdir -p /etc/containerd
|
mkdir -p /etc/containerd
|
||||||
sudo containerd config default|sudo tee /etc/containerd/config.toml
|
containerd config default|sudo tee /etc/containerd/config.toml
|
||||||
|
|
||||||
# restart containerd
|
# restart containerd
|
||||||
sudo systemctl restart containerd
|
systemctl restart containerd
|
||||||
sudo systemctl enable containerd
|
systemctl enable containerd
|
||||||
systemctl status containerd
|
systemctl status containerd
|
||||||
Reference in New Issue
Block a user