반응형
https://killer.sh 모의고사 오답노트입니다.
Question 18 | Fix Kubelet
Q. There seems to be an issue with the kubelet not running on cluster3-worker1
. Fix it and confirm that cluster has node cluster3-worker1
available in Ready state afterwards. You should be able to schedule a Pod on cluster3-worker1
afterwards.
Write the reason of the issue into /opt/course/18/reason.txt
.
worker1 에서 kubelet 이 동작하지 않는 것 같다. 고쳐리.
키워드
- ps aux
- systemd
- journalctl -u kubelet
-
service kubelet status
- 상태를 확인한다.
➜ k get node
NAME STATUS ROLES AGE VERSION
cluster3-master1 Ready master 27h v1.23.1
cluster3-worker1 NotReady <none> 26h v1.23.1
- worker1 내부에 들어가서 kubelet 을 확인한다.
➜ ssh cluster3-worker1
➜ root@cluster3-worker1:~# ps aux | grep kubelet
root 29294 0.0 0.2 14856 1016 pts/0 S+ 11:30 0:00 grep --color=auto kubelet
- kubectl 서비스 상태를 확인한다.
➜ root@cluster3-worker1:~# service kubelet status
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: inactive (dead) since Sun 2019-12-08 11:30:06 UTC; 50min 52s ago
...
- 뒤져있으니 시작을 해보자.
➜ service kubelet start
➜ service kubelet status
kubelet.service - kubelet: The Kubernetes Node Agent (여기에 본인 설정 위치 나옴!)
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: activating (auto-restart) (Result: exit-code) since Thu 2020-04-30 22:03:10 UTC; 3s ago
Docs: https://kubernetes.io/docs/home/
Process: 5989 ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=203/EXEC)
Main PID: 5989 (code=exited, status=203/EXEC)
Apr 30 22:03:10 cluster3-worker1 systemd[5989]: kubelet.service: Failed at step EXEC spawning /usr/local/bin/kubelet: No such file or directory
Apr 30 22:03:10 cluster3-worker1 systemd[1]: kubelet.service: Main process exited, code=exited, status=203/EXEC
Apr 30 22:03:10 cluster3-worker1 systemd[1]: kubelet.service: Failed with result 'exit-code'.
/usr/local/bin/kubelet
이 없다고 뜬다.
- kubelet 의 위치를 찾는다.
➜ whereis kubelet
➜ root@cluster3-worker1:~# whereis kubelet
kubelet: /usr/bin/kubelet
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
여기 가서 kubelet 위치 고친다.
systemctl daemon-reload && systemctl restart kubelet
systemctl status kubelet # should now show running
- 나와서 노드상태 확인한다. (시간이 지나면 반영됨)
반응형
'쿠버네티스' 카테고리의 다른 글
cka 준비 팁 (0) | 2022.10.03 |
---|---|
[ cka 준비 오답노트 ] Update Kubernetes Version and join cluster (0) | 2022.10.03 |