[GPU] RockyLinux 9.4 환경에서 RKE2 구성 및 GPU 테스트 - II - RKE2 설치
페이지 정보
본문
안녕하세요.
꿈꾸는여행자입니다.
지난 내용에 계속하여 올립니다.
이번 항목에서는
RKE2 설치에 대한 요건 확인 내용입니다.
상세 내역은 아래와 같습니다.
감사합니다.
> 아래
________________
목차
1.5. Installation Methods
1.5.1. Tarball
1.5.1.1. Installation
1.5.1.2. Start rke2-server
1.5.1.3. Set Env
1.5.1.4. Linux Agent (Worker) Node Installation
1.5.1.4.0. Taint 제거 방법
1.5.1.4.1. Run the installer
1.5.1.4.2. Enable the rke2-agent service
1.5.1.4.3. Configure the rke2-agent service
1.5.1.4.4. Start the service
1.5.1.4.5. Follow the logs, if you like
________________
1.5. Installation Methods
Important: If your node has NetworkManager installed and enabled, ensure that it is configured to ignore CNI-managed interfaces.
RKE2 can be installed to a system in a number of ways, two of which are the preferred and supported methods. Those methods are tarball and RPM. The install script referenced in the Quick Start is a wrapper around these two methods.
This document explains these installation methods in greater detail.
1.5.1. Tarball
To install RKE2 via install you first need to get the install script. This can be done in a number of ways.
This gets the script and immediately starts the installation process.
# curl -sfL https://get.rke2.io | sudo sh -
curl -sfL https://get.rke2.io | sh -
Alternatively, you can download the install script and make it executable.
curl -sfL https://get.rke2.io --output install.sh
chmod +x install.sh
[root@host Work]# mkdir 20241017_RKE2
[root@host Work]# cd 20241017_RKE2/
[root@host 20241017_RKE2]# curl -sfL https://get.rke2.io --output install.sh
[root@host 20241017_RKE2]# pwd
/root/Work/20241017_RKE2
[root@host 20241017_RKE2]# chmod +x install.sh
[root@host 20241017_RKE2]# ls -al
total 28
drwxr-xr-x. 2 root root 24 Oct 17 10:27 .
drwxr-xr-x. 6 root root 100 Oct 17 10:27 ..
-rwxr-xr-x. 1 root root 24976 Oct 17 10:27 install.sh
[root@host 20241017_RKE2]#
1.5.1.1. Installation
The installation process defaults to the latest RKE2 version and no other qualifiers are necessary. However, if you want to specify a version, you should set the INSTALL_RKE2_CHANNEL environment variable. An example below:
INSTALL_RKE2_CHANNEL=latest ./install.sh
INSTALL_RKE2_CHANNEL=v1.30.5+rke2r1 ./install.sh
[root@host 20241017_RKE2]# INSTALL_RKE2_CHANNEL=v1.30.5+rke2r1 ./install.sh
[INFO] using stable RPM repositories
[INFO] using 1.30 series from channel stable
Rancher RKE2 Common (v1.30.5+rke2r1) 1.4 kB/s | 1.9 kB 00:01
Rancher RKE2 1.30 (v1.30.5+rke2r1) 3.2 kB/s | 3.6 kB 00:01
Dependencies resolved.
===================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================
Installing:
rke2-server x86_64 1.30.5~rke2r1-0.el9 rancher-rke2-1.30-stable 9.0 k
Installing dependencies:
rke2-common x86_64 1.30.5~rke2r1-0.el9 rancher-rke2-1.30-stable 25 M
rke2-selinux noarch 0.18-1.el9 rancher-rke2-common-stable 22 k
Transaction Summary
===================================================================================================================================
Install 3 Packages
Total download size: 25 M
Installed size: 104 M
Downloading Packages:
(1/3): rke2-selinux-0.18-1.el9.noarch.rpm 44 kB/s | 22 kB 00:00
(2/3): rke2-server-1.30.5~rke2r1-0.el9.x86_64.rpm 12 kB/s | 9.0 kB 00:00
(3/3): rke2-common-1.30.5~rke2r1-0.el9.x86_64.rpm 14 MB/s | 25 MB 00:01
-----------------------------------------------------------------------------------------------------------------------------------
Total 14 MB/s | 25 MB 00:01
Rancher RKE2 Common (v1.30.5+rke2r1) 4.1 kB/s | 2.4 kB 00:00
Importing GPG key 0xE257814A:
Userid : "Rancher (CI) <ci@rancher.com>"
Fingerprint: C8CF F216 4551 26E9 B9C9 18BE 925E A29A E257 814A
From : https://rpm.rancher.io/public.key
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: rke2-selinux-0.18-1.el9.noarch 1/3
Installing : rke2-selinux-0.18-1.el9.noarch 1/3
Running scriptlet: rke2-selinux-0.18-1.el9.noarch 1/3
Installing : rke2-common-1.30.5~rke2r1-0.el9.x86_64 2/3
Installing : rke2-server-1.30.5~rke2r1-0.el9.x86_64 3/3
Running scriptlet: rke2-server-1.30.5~rke2r1-0.el9.x86_64 3/3
Running scriptlet: rke2-selinux-0.18-1.el9.noarch 3/3
Running scriptlet: rke2-server-1.30.5~rke2r1-0.el9.x86_64 3/3
Verifying : rke2-selinux-0.18-1.el9.noarch 1/3
Verifying : rke2-common-1.30.5~rke2r1-0.el9.x86_64 2/3
Verifying : rke2-server-1.30.5~rke2r1-0.el9.x86_64 3/3
Installed:
rke2-common-1.30.5~rke2r1-0.el9.x86_64 rke2-selinux-0.18-1.el9.noarch rke2-server-1.30.5~rke2r1-0.el9.x86_64
Complete!
[root@host 20241017_RKE2]#
When the install script is executed, it makes a determination of what type of system it is. If it's an OS that uses RPMs (such as CentOS or RHEL), it will perform an RPM based installation, otherwise the script defaults to tarball. RPM based installation is covered below.
Next, the installation script downloads the tarball, verifies it by comparing SHA256 hashes, and lastly, extracts the contents to /usr/local. An operator is free to move the files after installation if desired. This operation simply extracts the tarball and no other system modifications are made.
Tarball structure / contents
* bin - contains the RKE2 executable as well as the rke2-killall.sh and rke2-uninstall.sh scripts
* lib - contains server and agent systemd unit files
* share - contains the RKE2 license as well as a sysctl configuration file used for when RKE2 is ran in CIS mode
To configure the system any further, you'll want to reference either the server or agent documentation.
1.5.1.2. Start rke2-server
Enable the rke2-server service
systemctl enable rke2-server.service
systemctl disable rke2-server.service
[root@host ~]# systemctl enable rke2-server.service
Created symlink /etc/systemd/system/multi-user.target.wants/rke2-server.service → /usr/lib/systemd/system/rke2-server.service.
[root@host ~]#
Start the service
* 3분 소요
systemctl start rke2-server.service
[root@host ~]# systemctl start rke2-server.service
…
[root@host ~]# systemctl status rke2-server.service
● rke2-server.service - Rancher Kubernetes Engine v2 (server)
Loaded: loaded (/usr/lib/systemd/system/rke2-server.service; enabled; preset: disabled)
Active: active (running) since Thu 2024-10-17 11:07:07 KST; 54s ago
Docs: https://github.com/rancher/rke2#readme
Process: 7164 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service (code=exited, status=0/S>
Process: 7166 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
Process: 7170 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
Main PID: 7171 (rke2)
Tasks: 217
Memory: 3.0G
CPU: 2min 56.789s
CGroup: /system.slice/rke2-server.service
├─ 7171 "/usr/bin/rke2 server"
├─ 7194 containerd -c /var/lib/rancher/rke2/agent/etc/containerd/config.toml -a /run/k3s/containerd/containerd.sock ->
├─ 7326 kubelet --volume-plugin-dir=/var/lib/kubelet/volumeplugins --file-check-frequency=5s --sync-frequency=30s --a>
├─ 7404 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 97f9>
├─ 7412 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id e71d>
├─ 7578 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 595e>
├─ 7684 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id d15c>
├─ 7696 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id b626>
├─ 7870 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 375f>
├─ 8746 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id f1e1>
├─11619 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 2fdc>
├─11800 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 7a87>
├─12337 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 4112>
├─12387 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 1f48>
├─12585 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 9af3>
├─13019 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 985d>
└─13283 /var/lib/rancher/rke2/data/v1.30.5-rke2r1-03c8840a76df/bin/containerd-shim-runc-v2 -namespace k8s.io -id 9b2c>
Oct 17 11:07:09 host.example.com rke2[7171]: time="2024-10-17T11:07:09+09:00" level=info msg="Starting helm.cattle.io/v1, Kind=Hel>
Oct 17 11:07:09 host.example.com rke2[7171]: time="2024-10-17T11:07:09+09:00" level=info msg="Starting rbac.authorization.k8s.io/v>
Oct 17 11:07:09 host.example.com rke2[7171]: time="2024-10-17T11:07:09+09:00" level=info msg="Starting batch/v1, Kind=Job controll>
Oct 17 11:07:09 host.example.com rke2[7171]: time="2024-10-17T11:07:09+09:00" level=info msg="Reconciling snapshot ConfigMap data"
Oct 17 11:07:10 host.example.com rke2[7171]: time="2024-10-17T11:07:10+09:00" level=info msg="Updating TLS secret for kube-system/>
Oct 17 11:07:10 host.example.com rke2[7171]: time="2024-10-17T11:07:10+09:00" level=info msg="Updating TLS secret for kube-system/>
Oct 17 11:07:11 host.example.com rke2[7171]: time="2024-10-17T11:07:11+09:00" level=info msg="Active TLS secret kube-system/rke2-s>
Oct 17 11:07:11 host.example.com rke2[7171]: time="2024-10-17T11:07:11+09:00" level=info msg="Labels and annotations have been set>
Oct 17 11:07:16 host.example.com rke2[7171]: time="2024-10-17T11:07:16+09:00" level=info msg="Adding node host.example.com-cb9da18>
Oct 17 11:07:41 host.example.com rke2[7171]: time="2024-10-17T11:07:41+09:00" level=info msg="Tunnel authorizer set Kubelet Port 0>
lines 1-40/40 (END)
Follow the logs, if you like
journalctl -u rke2-server -f
After running this installation:
* The rke2-server service will be installed. The rke2-server service will be configured to automatically restart after node reboots or if the process crashes or is killed.
* Additional utilities will be installed at /var/lib/rancher/rke2/bin/. They include: kubectl, crictl, and ctr. Note that these are not on your path by default.
* Two cleanup scripts, rke2-killall.sh and rke2-uninstall.sh, will be installed to the path at:
* /usr/local/bin for regular file systems
* /opt/rke2/bin for read-only and brtfs file systems
* INSTALL_RKE2_TAR_PREFIX/bin if INSTALL_RKE2_TAR_PREFIX is set
* A kubeconfig file will be written to /etc/rancher/rke2/rke2.yaml.
* A token that can be used to register other server or agent nodes will be created at /var/lib/rancher/rke2/server/node-token
ls -al /var/lib/rancher/rke2/bin/
ls -al /etc/rancher/rke2/rke2.yaml
[root@host ~]# ls -al /var/lib/rancher/rke2/bin/
total 319776
drwxr-xr-x. 2 root root 176 Oct 17 11:05 .
drwxr-xr-x. 4 root root 31 Oct 17 11:05 ..
-rwxr-xr-x. 1 root root 60693288 Oct 17 11:05 containerd
-rwxr-xr-x. 1 root root 8260536 Oct 17 11:05 containerd-shim
-rwxr-xr-x. 1 root root 9361688 Oct 17 11:05 containerd-shim-runc-v1
-rwxr-xr-x. 1 root root 14441040 Oct 17 11:05 containerd-shim-runc-v2
-rwxr-xr-x. 1 root root 42287696 Oct 17 11:05 crictl
-rwxr-xr-x. 1 root root 21522384 Oct 17 11:05 ctr
-rwxr-xr-x. 1 root root 56354064 Oct 17 11:05 kubectl
-rwxr-xr-x. 1 root root 102301744 Oct 17 11:05 kubelet
-rwxr-xr-x. 1 root root 12208272 Oct 17 11:05 runc
[root@host ~]#
[root@host ~]# ls -al /etc/rancher/rke2/rke2.yaml
-rw-------. 1 root root 2973 Oct 17 11:05 /etc/rancher/rke2/rke2.yaml
[root@host ~]#
* note
댓글목록
등록된 댓글이 없습니다.