쿠버네티스 설치
vi /etc/hosts
vi /etc/sysconfig/selinux
>> disabled
systemctl stop firewalld
systemctl disable firewalld
swapoff -a
vi /etc/fstab
modprobe br_netfilter
sysctl -w net.ipv4.ip_forward=1
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
# 필요한 sysctl 파라미터를 설정하면, 재부팅 후에도 값이 유지된다.
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
# 재부팅하지 않고 sysctl 파라미터 적용하기
sudo sysctl --system
KUBERNETES_VERSION=v1.29
PROJECT_PATH=stable:/main
cat <<EOF | tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/$KUBERNETES_VERSION/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/$KUBERNETES_VERSION/rpm/repodata/repomd.xml.key
EOF
cat <<EOF | tee /etc/yum.repos.d/cri-o.repo
[cri-o]
name=CRI-O
baseurl=https://pkgs.k8s.io/addons:/cri-o:/$PROJECT_PATH/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/addons:/cri-o:/$PROJECT_PATH/rpm/repodata/repomd.xml.key
EOF
dnf install -y container-selinux
dnf install -y cri-o kubelet kubeadm kubectl
systemctl enable kubelet.service
vi /etc/crio/crio.conf.d/10-crun.conf
systemctl start crio.service
systemctl enable crio.service
wget https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 15s default-scheduler Successfully assigned default/pod to redev-wk2
Warning FailedCreatePodSandBox 15s kubelet Failed to create pod sandbox: rpc error: code = Unknown deeeb-466b-8de8-06e7cf4e555b_0(57877459e3d496ea8af4217ed48fd487f6046fc59868de964ab7f5e8c7f13168): error adding pod defauiled to delegate add: failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24
Warning FailedCreatePodSandBox 1s kubelet Failed to create pod sandbox: rpc error: code = Unknown deeeb-466b-8de8-06e7cf4e555b_0(2186366ac8960089bd73786ff12ba8312c5b17bec3a0f5fc4eab2c130cfd56de): error adding pod defauiled to delegate add: failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24
ifconfig cni0 down
rm /etc/cni/net.d/11-crio-ipv4-bridge.conflist
ip link delete cni0