-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep-fedora.sh
56 lines (35 loc) · 1 KB
/
prep-fedora.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
swapoff -a
systemctl mask swap.target
dnf update
dnf -y install curl vim gpg wget iproute-tc
cat <<EOF | tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
depmod
cat <<EOF | tee /etc/sysctl.d/99-kubernetes-k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF
sysctl --system
dnf -y install containerd
containerd config default | tee /etc/containerd/config.toml >/dev/null 2>&1
sed -i -e "s#SystemdCgroup = false#SystemdCgroup = true#" /etc/containerd/config.toml
systemctl restart containerd
systemctl enable --now containerd
cat <<EOF | tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
EOF
dnf -y update
dnf -y install kubelet kubeadm kubectl
systemctl enable --now kubelet
systemctl disable --now firewalld
systemctl enable kubelet
reboot