Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
linux_faq:kubernetes_using_single_node_as_master_and_worker [2022/04/23 17:26] – [Обновление kubernetes] admin | linux_faq:kubernetes_using_single_node_as_master_and_worker [2022/04/28 11:25] – [Single node Kubernetes setup - Ubuntu 18.04] admin | ||
---|---|---|---|
Line 8: | Line 8: | ||
| | ||
echo 'deb http:// | echo 'deb http:// | ||
- | curl -s https:// | + | |
- | | + | |
+ | gpg_keyring_path="/ | ||
+ | curl -fsSL " | ||
+ | |||
+ | cat <<EOF | sudo tee / | ||
+ | overlay | ||
+ | br_netfilter | ||
+ | EOF | ||
+ | |||
+ | sudo modprobe overlay | ||
+ | sudo modprobe br_netfilter | ||
+ | |||
+ | # Setup required sysctl params, these persist across reboots. | ||
+ | cat <<EOF | sudo tee / | ||
+ | net.bridge.bridge-nf-call-iptables | ||
+ | net.ipv4.ip_forward | ||
+ | net.bridge.bridge-nf-call-ip6tables = 1 | ||
+ | EOF | ||
+ | |||
+ | # Apply sysctl params without reboot | ||
+ | sudo sysctl --system | ||
sudo apt-get update | sudo apt-get update | ||
- | sudo apt-get install -y docker.io kubeadm kubelet | + | |
+ | sudo apt-get install -y containerd | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | " | + | cat << EOF | sudo tee / |
- | " | + | [Unit] |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | | + | |
EOF | EOF | ||
| | ||
- | sudo mkdir -p /etc/systemd/system/docker.service.d | + | sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' |
+ | sudo service | ||
| | ||
- | # Enable services and restart docker. | ||
- | sudo systemctl daemon-reload | ||
- | sudo systemctl enable docker | ||
- | sudo systemctl restart docker | ||
- | sudo systemctl enable kubelet.service | ||
| | ||
- | sudo usermod -a -G docker $USER | ||
- | | ||
- | # To ensure that kubelet starts only after docker: | ||
- | cat << EOF | sudo tee / | ||
- | [Unit] | ||
- | After=docker.service | ||
- | EOF | ||
- | |||
# Kubernetes Cluster Init | # Kubernetes Cluster Init | ||
- | sudo kubeadm init --pod-network-cidr=10.244.0.0/ | + | sudo kubeadm init --cri-socket / |
| | ||
mkdir -p $HOME/.kube | mkdir -p $HOME/.kube | ||
Line 379: | Line 385: | ||
# Let's Encrypt will use this to contact you about expiring | # Let's Encrypt will use this to contact you about expiring | ||
# certificates, | # certificates, | ||
- | email: | + | email: |
server: https:// | server: https:// | ||
privateKeySecretRef: | privateKeySecretRef: |