https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/
- Kubernetes의 v1.20 부터 docker-shim이 deprecated 됨
- Mirantis에서 docker 인수 후 cri-dockerd 프로젝트 지원
- Kubernetes + docker를 활용하려면 cri-dockerd 필요 (docker-shim은 지원 중단)
1. 작업용 서버에서 cri-dockerd 빌드
(1) git 설치
# dnf install git
# git init
Initialized empty Git repository in /root/.git/
(2) cri-dockerd
# git clone https://github.com/Mirantis/cri-dockerd
Cloning into 'cri-dockerd'...
remote: Enumerating objects: 6083, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 6083 (delta 12), reused 6 (delta 0), pack-reused 6045
Receiving objects: 100% (6083/6083), 23.96 MiB | 9.49 MiB/s, done.
Resolving deltas: 100% (3785/3785), done.
(3) go 설치
# wget https://storage.googleapis.com/golang/getgo/installer_linux
# chmod +x ./installer_linux
# ./installer_linux
# source ~/.bash_profile
(4) cri-dockerd 빌드
# cd cri-dockerd
# mkdir bin
# go get && go build -o bin/cri-dockerd
go: downloading k8s.io/component-base v0.20.4
…
…
go: downloading github.com/coreos/go-semver v0.3.0
2. 빌드된 폴더를 설치할 서버로 옮겨 cri-dockerd 설치
(1) cri-dockerd 폴더 복사
(2) 설치
# mkdir -p /usr/local/bin
# install -o root -g root -m 0755 bin/cri-dockerd /usr/local/bin/cri-dockerd
# cp -a packaging/systemd/* /etc/systemd/system
# sed -i -e 's,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' /etc/systemd/system/cri-docker.service
# systemctl daemon-reload
# systemctl enable cri-docker.service
Created symlink /etc/systemd/system/multi-user.target.wants/cri-docker.service → /etc/systemd/system/cri-docker.service.
# systemctl enable --now cri-docker.socket
Created symlink /etc/systemd/system/sockets.target.wants/cri-docker.socket → /etc/systemd/system/cri-docker.socket.
3. Kubernetes의 master 설치 및 worker join 시 cri-dockerd 옵션 사용
# kubeadm init --pod-network-cidr=172.16.0.0/16 --cri-socket /var/run/cri-dockerd.sock
W0608 07:42:08.015411 1835 initconfiguration.go:120] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme "unix" to the "criSocket" with value "/var/run/cri-dockerd.sock". Please update your configuration!
# kubeadm join 192.168.8.41:6443 --token 06ji47.m60cgttawci9pzg1 \
--discovery-token-ca-cert-hash sha256:c69fcca85f8779bf0a9d4603bba4d0dc1348ce54b8c7d0b21b431a6970f4cf58 \ --cri-socket /var/run/cri-dockerd.sock
W0608 08:06:31.593374 2089 initconfiguration.go:120] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme "unix" to the "criSocket" with value "/var/run/cri-dockerd.sock". Please update your configuration!
'IT > Kubernetes, Docker' 카테고리의 다른 글
docker - network (0) | 2022.06.14 |
---|---|
docker 설치 및 기본 사용법 (on RHEL8) (0) | 2022.06.14 |
Kubernetes 설치 (Redhat8, Single Master) (0) | 2022.06.14 |