"Killer Shell CKA - Apiserver Crash"의 두 판 사이의 차이

35번째 줄: 35번째 줄:
<syntaxhighlight lang='console'>
<syntaxhighlight lang='console'>
controlplane:~$ crictl ps -a | grep apiserver
controlplane:~$ crictl ps -a | grep apiserver
d4f2aead6efd1       ee794efa53d85      About a minute ago   Exited              kube-apiserver            5                   52e3a48665b8e       kube-apiserver-controlplane              kube-system
c2fd5e7298b80       ee794efa53d85      1 second ago       Exited              kube-apiserver            1                   395619c032af5       kube-apiserver-controlplane              kube-system
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='console'>
<syntaxhighlight lang='console'>
controlplane:~$ crictl logs d4f2aead6efd1   
controlplane:~$ crictl logs c2fd5e7298b80
...
Error: unknown flag: --this-is-very-wrong
W0918 10:29:07.635469      1 logging.go:55] [core] [Channel #5 SubChannel #6]grpc: addrConn.createTransport failed to connect to {Addr: "this-is-very-wrong", ServerName: "this-is-very-wrong", }. Err: connection error: desc = "transport: Error while dialing: dial tcp: address this-is-very-wrong: missing port in address"
W0918 10:29:08.626327      1 logging.go:55] [core] [Channel #2 SubChannel #4]grpc: addrConn.createTransport failed to connect to {Addr: "this-is-very-wrong", ServerName: "this-is-very-wrong", }. Err: connection error: desc = "transport: Error while dialing: dial tcp: address this-is-very-wrong: missing port in address"
</syntaxhighlight>
</syntaxhighlight>



2025년 9월 19일 (금) 20:01 판

1 개요

Killer Shell CKA - Apiserver Crash

2 최초 상태

controlplane:~$ k get pod -A | grep api
kube-system          kube-apiserver-controlplane               1/1     Running   1 (27m ago)   31d

3 수정1

# 수정 전 원본 백업!
cp /etc/kubernetes/manifests/kube-apiserver.yaml ~/kube-apiserver.yaml.ori

kube-apiserver를 Crash 시키기 위해 매니페스트 파일에 잘못된 인수를 추가한다.

controlplane:~$ vim /etc/kubernetes/manifests/kube-apiserver.yaml
...
  - command:
    - kube-apiserver
    - --this-is-very-wrong ## 추가
    - --advertise-address=172.30.1.2

4 확인1

controlplane:~$ k get pod -A
The connection to the server 172.30.1.2:6443 was refused - did you specify the right host or port?
controlplane:~$ crictl ps -a | grep apiserver
c2fd5e7298b80       ee794efa53d85       1 second ago        Exited              kube-apiserver            1                   395619c032af5       kube-apiserver-controlplane               kube-system
controlplane:~$ crictl logs c2fd5e7298b80
Error: unknown flag: --this-is-very-wrong

5 복구1

controlplane:~$ cp ~/kube-apiserver.yaml.ori /etc/kubernetes/manifests/kube-apiserver.yaml
controlplane:~$ kubectl get pod -A | grep api
kube-system          kube-apiserver-controlplane               1/1     Running   0               31d

6 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}