마구잡

Kubernetes Binary 설치 - 1 본문

Kubernetes

Kubernetes Binary 설치 - 1

MAGUJOB 2024. 2. 19. 14:46
반응형

개요

Kubespray, minikube, EKS등 여러 Kubernetes Cluster를 설치하는 Tool 및 서비스가 존재한다.

이번 글에선 좀 귀찮더라도 Binary 설치를 진행한다.

 

(사실 나는 Binary 설치를 더 많이 진행한터라 이 방법에 제일 편한데 따로 글로 정리를 안해봐서 이번에 클러스터 재구성 및 정리를 해보려 한다.)

필요사항

클러스터를 구축하기 위한 기본적인 통신, OS 스펙에 대한 설정은 건너뛴다.

Redhat 계열 OS로 진행한다.

CNI는 Calico로 선택한다.

본문

containerd: https://github.com/containerd/containerd/releases

 

Releases · containerd/containerd

An open and reliable container runtime. Contribute to containerd/containerd development by creating an account on GitHub.

github.com

CNI Plugin: https://github.com/containernetworking/plugins/releases

 

Releases · containernetworking/plugins

Some reference and example networking plugins, maintained by the CNI team. - containernetworking/plugins

github.com

runc: https://github.com/opencontainers/runc/releases

 

Releases · opencontainers/runc

CLI tool for spawning and running containers according to the OCI specification - opencontainers/runc

github.com

calico: https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises#install-calico

 

Install Calico networking and network policy for on-premises deployments | Calico Documentation

Install Calico networking and network policy for on-premises deployments.

docs.tigera.io


wget을 이용하여 각 Binary, Yaml, Systemd 가져오기

wget https://github.com/containernetworking/plugins/releases/download/v1.4.0/cni-plugins-linux-amd64-v1.4.0.tgz
wget https://github.com/containerd/containerd/releases/download/v1.7.13/containerd-1.7.13-linux-amd64.tar.gz
wget https://raw.githubusercontent.com/containerd/containerd/main/containerd.service
wget https://github.com/opencontainers/runc/releases/download/v1.1.12/runc.amd64
wget https://docs.tigera.io/calico/latest/manifests/calico.yaml

Binary 압축 해제 및 설치

1.runc 설치

install -m 755 runc.amd64 /usr/local/sbin/runc

 

2. containerd 설치

tar Cxzvf /usr/bin/ containerd-1.7.13-linux-amd64.tar.gz
tar Cxzvf /usr/local/ containerd-1.7.13-linux-amd64.tar.gz

 

2-1. containerd systemd 등록

cp containerd.service /usr/lib/systemd/system/

 

3. CNI plugin 설치

mkdir -p /opt/cni/bin
tar Cxzvf /opt/cni/bin  cni-plugins-linux-amd64-v1.4.0.tgz

 

4. containerd config.toml 생성

mkdir -p /etc/containerd
containerd config default > /etc/containerd/config.toml

 

4-1. containerd config.toml 수정 (docker hub 계정은 필수가 아닙니다.)

vi /etc/containerd/config.toml

 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
...
  SystemdCgroup = true
...
    [plugins."io.containerd.grpc.v1.cri".registry.configs."registry-1.docker.io".auth]
      username = "도커허브 계정"
      password = "도커허브 패스워드"
...

 

5. systemd damon-reload & start 

systemctl daemon-reload
systemctl enable --now containerd

 

6. containerd status

● containerd.service - containerd container runtime
   Loaded: loaded (/usr/lib/systemd/system/containerd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2024-02-19 00:36:49 EST; 5min ago
     Docs: https://containerd.io
  Process: 245966 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
 Main PID: 245967 (containerd)
    Tasks: 87
   Memory: 1.5G
   CGroup: /system.slice/containerd.service

 

다음 글에서 계속

https://mgujob.tistory.com/12

 

Kubernetes Binary 설치 - 2

https://mgujob.tistory.com/11 이전 내용에서 계속 Kubernetes Binary 설치 - 1 개요 Kubespray, minikube, EKS등 여러 Kubernetes Cluster를 설치하는 Tool 및 서비스가 존재한다. 이번 글에선 좀 귀찮더라도 Binary 설치를 진

mgujob.tistory.com

 

반응형