테스트 - 총 50분 소요

 

대상서버 : 192.168.110.115 k8s-worker02

 

 

기존 설정

root@k8s-master01:~# kubectl get nodes -o wide
NAME           STATUS   ROLES           AGE   VERSION   INTERNAL-IP       EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
k8s-master01   Ready    control-plane   56d   v1.24.6   192.168.110.111   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic   containerd://1.6.8
k8s-master02   Ready    control-plane   56d   v1.24.6   192.168.110.112   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic   containerd://1.6.8
k8s-master03   Ready    control-plane   56d   v1.24.6   192.168.110.113   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic   containerd://1.6.8
k8s-worker01   Ready    <none>          56d   v1.24.6   192.168.110.114   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic   containerd://1.6.8
k8s-worker02   Ready    <none>          56d   v1.24.6   192.168.110.115   <none>        Ubuntu 20.04.5 LTS   5.4.0-135-generic   containerd://1.6.8

 

Kubernetes 프로세스 종료

root@k8s-worker02:~# systemctl stop kubelet
root@k8s-worker02:~# systemctl stop containerd.service

 


 

업그레이드

  1. 패키지 및 서버 최신버전으로 업데이트
sudo apt update && sudo apt upgrade -y

...

Configuration file '/etc/cloud/cloud.cfg'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** cloud.cfg (Y/I/N/O/D/Z) [default=N] ?
N
root@k8s-worker02:~# sudo apt dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  cgroupfs-mount pigz
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

2. 불필요 패키지 삭제

root@k8s-worker02:~# sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  cgroupfs-mount pigz
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 292 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 96247 files and directories currently installed.)
Removing cgroupfs-mount (1.4) ...
Removing pigz (2.4-1) ...
Processing triggers for man-db (2.9.1-1) ...

3. 코어 업데이트를 위한 패키지 설치

root@k8s-worker02:~# sudo apt install update-manager-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
update-manager-core is already the newest version (1:20.04.10.11).
update-manager-core set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

4. 업그레이드

root@k8s-worker02:~# sudo do-release-upgrade
Checking for a new Ubuntu release
You have not rebooted after updating a package which requires a reboot. Please reboot before upgrading.

root@k8s-worker02:~# reboot
nginx 종료 기다리고 있어서 하드리부트 

재시도

root@k8s-worker02:~# sudo do-release-upgrade
...
If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?

Continue [yN] y

---

Do you want to start the upgrade?


5 packages are going to be removed. 105 new packages are going to be
installed. 575 packages are going to be upgraded.

You have to download a total of 567 M. This download will take about
2 minutes with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]
 y
 
 ... 
 

yes

...
Configuration file '/etc/systemd/resolved.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** resolved.conf (Y/I/N/O/D/Z) [default=N] ?
N
...

중간에 GUI 화면으로 커널 버전 그대로 쓸건지 물어봄 (default : 기존버전사용)

root@k8s-worker02:~# uname -a
Linux k8s-worker02 5.4.0-139-generic #156-Ubuntu SMP Fri Jan 20 17:27:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@k8s-worker02:~#
root@k8s-worker02:~# more /etc/*release
::::::::::::::
/etc/lsb-release
::::::::::::::
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

커널 업데이트(5.19 테스트)

sudo add-apt-repository ppa:cappelikan/ppa -y

sudo apt install mainline -y
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19-rc8/
  wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19-rc8/amd64/linux-headers-5.19.0-051900rc8_5.19.0-051900rc8.202207242130_all.deb
  wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19-rc8/amd64/linux-image-unsigned-5.19.0-051900rc8-generic_5.19.0-051900rc8.202207242130_amd64.deb
  wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.19-rc8/amd64/linux-modules-5.19.0-051900rc8-generic_5.19.0-051900rc8.202207242130_amd64.deb
root@k8s-worker02:~# sudo dpkg -i *.deb
reboot -f
root@k8s-worker02:~# uname -r
5.19.0-051900rc8-generic
root@k8s-worker02:~# more /etc/*release
::::::::::::::
/etc/lsb-release
::::::::::::::
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
root@k8s-master01:~# kubectl get nodes -o wide
NAME           STATUS   ROLES           AGE   VERSION   INTERNAL-IP       EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION             CONTAINER-RUNTIME
k8s-master01   Ready    control-plane   56d   v1.24.6   192.168.110.111   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic          containerd://1.6.8
k8s-master02   Ready    control-plane   56d   v1.24.6   192.168.110.112   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic          containerd://1.6.8
k8s-master03   Ready    control-plane   56d   v1.24.6   192.168.110.113   <none>        Ubuntu 22.04.2 LTS   5.15.0-60-generic          containerd://1.6.8
k8s-worker01   Ready    <none>          56d   v1.24.6   192.168.110.114   <none>        Ubuntu 20.04.4 LTS   5.4.0-135-generic          containerd://1.6.8
k8s-worker02   Ready    <none>          56d   v1.24.6   192.168.110.115   <none>        Ubuntu 22.04.2 LTS   5.19.0-051900rc8-generic   containerd://1.6.8

root@k8s-master01:~# kubectl -n kube-system get pod -o wide
NAME                                      READY   STATUS    RESTARTS          AGE    IP                NODE           NOMINATED NODE   READINESS GATES
calico-kube-controllers-56fd7b8dc-n42cb   1/1     Running   78 (15d ago)      56d    192.168.110.114   k8s-worker01   <none>           <none>
calico-node-6jmxc                         1/1     Running   1 (52d ago)       56d    192.168.110.111   k8s-master01   <none>           <none>
calico-node-k7jpb                         1/1     Running   4 (40d ago)       56d    192.168.110.114   k8s-worker01   <none>           <none>
calico-node-lpf6w                         1/1     Running   7 (78m ago)       56d    192.168.110.115   k8s-worker02   <none>           <none>
calico-node-x55bh                         1/1     Running   1 (52d ago)       56d    192.168.110.112   k8s-master02   <none>           <none>
calico-node-zf7p9                         1/1     Running   2 (2m17s ago)     56d    192.168.110.113   k8s-master03   <none>           <none>
coredns-75dbf65849-m7kl7                  1/1     Running   0                 66m    10.233.113.6      k8s-master02   <none>           <none>
coredns-75dbf65849-mtt7d                  1/1     Running   0                 52d    10.233.66.3       k8s-master01   <none>           <none>
csi-nfs-controller-6495ffdf79-dlgkm       3/3     Running   0                 123m   192.168.110.114   k8s-worker01   <none>           <none>
csi-nfs-node-4mwrh                        3/3     Running   10 (2m17s ago)    51d    192.168.110.113   k8s-master03   <none>           <none>
csi-nfs-node-6nllb                        3/3     Running   0                 51d    192.168.110.111   k8s-master01   <none>           <none>
csi-nfs-node-h9jdc                        3/3     Running   8 (78m ago)       51d    192.168.110.115   k8s-worker02   <none>           <none>
csi-nfs-node-mkd92                        3/3     Running   2 (15d ago)       51d    192.168.110.114   k8s-worker01   <none>           <none>
csi-nfs-node-tp56l                        3/3     Running   0                 51d    192.168.110.112   k8s-master02   <none>           <none>
dns-autoscaler-59b8867c86-tzbwm           1/1     Running   1 (52d ago)       56d    10.233.113.4      k8s-master02   <none>           <none>
etcd-k8s-master01                         1/1     Running   3 (15d ago)       56d    192.168.110.111   k8s-master01   <none>           <none>
etcd-k8s-master02                         1/1     Running   3 (15d ago)       56d    192.168.110.112   k8s-master02   <none>           <none>
etcd-k8s-master03                         1/1     Running   4 (2m17s ago)     56d    192.168.110.113   k8s-master03   <none>           <none>
kube-apiserver-k8s-master01               1/1     Running   50 (15d ago)      56d    192.168.110.111   k8s-master01   <none>           <none>
kube-apiserver-k8s-master02               1/1     Running   48 (15d ago)      56d    192.168.110.112   k8s-master02   <none>           <none>
kube-apiserver-k8s-master03               1/1     Running   40 (2m17s ago)    56d    192.168.110.113   k8s-master03   <none>           <none>
kube-controller-manager-k8s-master01      1/1     Running   389 (25h ago)     56d    192.168.110.111   k8s-master01   <none>           <none>
kube-controller-manager-k8s-master02      1/1     Running   407 (4h53m ago)   56d    192.168.110.112   k8s-master02   <none>           <none>
kube-controller-manager-k8s-master03      1/1     Running   395 (2m17s ago)   56d    192.168.110.113   k8s-master03   <none>           <none>
kube-proxy-7lwpx                          1/1     Running   1 (52d ago)       56d    192.168.110.111   k8s-master01   <none>           <none>
kube-proxy-7p2hw                          1/1     Running   2 (2m17s ago)     56d    192.168.110.113   k8s-master03   <none>           <none>
kube-proxy-gwhtf                          1/1     Running   2 (78m ago)       56d    192.168.110.115   k8s-worker02   <none>           <none>
kube-proxy-tcrq7                          1/1     Running   0                 56d    192.168.110.114   k8s-worker01   <none>           <none>
kube-proxy-tr8fq                          1/1     Running   1 (52d ago)       56d    192.168.110.112   k8s-master02   <none>           <none>
kube-scheduler-k8s-master01               1/1     Running   382 (45h ago)     56d    192.168.110.111   k8s-master01   <none>           <none>
kube-scheduler-k8s-master02               1/1     Running   402 (4h53m ago)   56d    192.168.110.112   k8s-master02   <none>           <none>
kube-scheduler-k8s-master03               1/1     Running   393 (2m17s ago)   56d    192.168.110.113   k8s-master03   <none>           <none>
metrics-server-5ccdd99954-vn7p9           1/1     Running   0                 38d    10.233.125.3      k8s-worker01   <none>           <none>
nginx-proxy-k8s-worker01                  1/1     Running   0                 56d    192.168.110.114   k8s-worker01   <none>           <none>
nginx-proxy-k8s-worker02                  1/1     Running   2 (78m ago)       56d    192.168.110.115   k8s-worker02   <none>           <none>

 


현재 기본으로 사용중인 cgroup 버전 정보

root@k8s-worker02:~#  stat -fc %T /sys/fs/cgroup/
cgroup2fs


cgroup 컨트롤러 확인
root@k8s-worker02:~# ll /sys/fs/cgroup/cgroup.controllers
-r--r--r-- 1 root root 0 Feb 23 05:13 /sys/fs/cgroup/cgroup.controllers


*20.04버전
root@k8s-master01:~# ll /sys/fs/cgroup/cgroup.controllers
ls: cannot access '/sys/fs/cgroup/cgroup.controllers': No such file or directory

'Linux' 카테고리의 다른 글

[Ansible] Ubuntu Password 일괄 변경  (0) 2023.03.21
[Ubuntu] 20.04 커널버전 업그레이드  (0) 2023.03.20
[CentOS7] Ansible 5.x 설치  (0) 2023.02.09
[ubuntu] systemd에 관하여  (0) 2022.10.24
[Linux] CentOS repository 구성  (0) 2022.10.21

+ Recent posts