쿠버네티스 서버 설치
- update / upgrade / reboot
>> sudo apt update
>> sudo apt full-upgrade -y
>> sudo reboot
>> sudo apt autoremove
kubelet, kubeadm, kubectl 설치
- add repository
>> sudo apt -y install curl apt-transport-https
>> sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
>> echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list - install packages
>> sudo apt update
>> sudo apt -y install vim git curl wget kubelet kubeadm kubectl
>> sudo apt-mark hold kubelet kubeadm kubectl - 설치 확인
>> kubectl version --client && kubeadm version
Swap 끄기
- swap 끄기
>> sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
>> sudo swapoff -a - 커널 모듈 enable
>> sudo modprobe overlay
>> sudo modprobe br_netfilter - sysctl 설정
>> sudo tee /etc/sysctl.d/kubernetes.conf<<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF - sysctl reload
>> sudo sysctl --system
Docker 설정
Docker 설치했다고 가정 후 설정 내용디렉토리 생성>> sudo mkdir -p /etc/systemd/system/docker.service.ddamon json config 파일 생성>> sudo tee /etc/docker/daemon.json <<EOF{"exec-opts": ["native.cgroupdriver=systemd"],"log-driver": "json-file","log-opts": {"max-size": "100m"},"storage-driver": "overlay2"}EOF서비스 시작/enable>> sudo systemctl daemon-reload>> sudo systemctl restart docker>> sudo systemctl enable docker- Docker 대신 containerd 사용하기로 결정
- 위 내용 진행 후 폴더 삭제함
>> sudo rm -r /etc/systemd/system/docker.service.d
- docker service 정지
>> systemctl stop docker.service
>> systemctl stop docker.socket
Containerd 설치
- Configure persistent loading of modules
>> sudo tee /etc/modules-load.d/containerd.conf <<EOF
overlay
br_netfilter
EOF - Load at runtime
>> sudo modprobe overlay
>> sudo modprobe br_netfilter - sysctl 파라미터 설정 확인
>> sudo tee /etc/sysctl.d/kubernetes.conf<<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
- Reload
>> sudo sysctl --system - 패키지 설치
>> sudo apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates - Docker repo 추가
>> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
>> sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - containerd 설치
>> sudo apt update
>> sudo apt install -y containerd.io - containerd 설정
>> sudo su -
>> mkdir -p /etc/containerd
>> containerd config default>/etc/containerd/config.toml - restart containerd
>> sudo systemctl restart containerd
>> sudo systemctl enable containerd
>> systemctl status containerd
'만들기 > EagleEye' 카테고리의 다른 글
[EagleEye][환경세팅] 쿠버네티스 설치 3 - 워커노드 세팅 (0) | 2022.05.14 |
---|---|
[EagleEye][환경세팅] 쿠버네티스 설치 2 - 마스터노드 세팅 (0) | 2022.05.14 |
[EagleEye][서비스구현] Spring boot with Docker (0) | 2022.05.13 |
[EagleEye][서비스구현] Spring으로 간단 서비스 구현 (0) | 2022.05.12 |
[EagleEye][환경세팅] 채팅 서버 설치 (Vartalap) - 2차 시도 (0) | 2022.05.04 |