1) kubectl create 명령어를 쓰면 -> api server에서 받아서 인증 처리 한 후 등록한다.
2) kubelet

root@ip-172-31-4-27:~# ps -ef | grep kubelet
root     22208     1  2 00:40 ?        00:10:30 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2

root@ip-172-31-4-27:~# more /var/lib/kubelet/config.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
...
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s

root@ip-172-31-4-27:/etc/kubernetes/manifests# ls
etcd.yaml  kube-apiserver.yaml	kube-controller-manager.yaml  kube-scheduler.yaml

4인방이 yaml 명세서로 정의되어 있는 것을 확인 할 수 있다.
1.master가 올라면서 -> 2.kubelet이 실행되고 -> 3.4인 방을 실행한다.

 

root@ip-172-31-4-27:/etc/kubernetes/manifests# kubectl get po -n kube-system 
NAME                                     READY   STATUS    RESTARTS   AGE
coredns-f9fd979d6-5t4g6                  1/1     Running   0          6h21m
coredns-f9fd979d6-r9p5f                  1/1     Running   0          6h21m
etcd-ip-172-31-4-27                      1/1     Running   0          6h21m
kube-apiserver-ip-172-31-4-27            1/1     Running   0          6h21m
kube-controller-manager-ip-172-31-4-27   1/1     Running   0          6h21m
kube-proxy-28mlr                         1/1     Running   0          6h3m
kube-proxy-tn6qw                         1/1     Running   0          6h21m
kube-scheduler-ip-172-31-4-27            1/1     Running   0          6h21m

4인방은 kubelet에 의해 master 호스트가 붙는 것을 확인 할 수 있다.

root@ip-172-31-4-27:~# cp simple.yml /etc/kubernetes/manifests/
root@ip-172-31-4-27:~# ls /etc/kubernetes/manifests/
etcd.yaml  kube-apiserver.yaml	kube-controller-manager.yaml  kube-scheduler.yaml  simple.ym

해당 위치에 yaml 명세서만 존재 해도 바로 시작이 된다. 

이것이 static pod이다.

root@ip-172-31-4-27:~# kubectl get po --all-namespaces | grep 172
default           mypod-ip-172-31-4-27                       1/1     Running   0          74s
kube-system       etcd-ip-172-31-4-27                        1/1     Running   0          6h25m
kube-system       kube-apiserver-ip-172-31-4-27              1/1     Running   0          6h25m
kube-system       kube-controller-manager-ip-172-31-4-27     1/1     Running   0          6h25m
kube-system       kube-scheduler-ip-172-31-4-27              1/1     Running   0          6h25m

system pod로 올리고자 할때 위와 같이 한다.

'클라우드 컴퓨팅 & NoSQL > k8s' 카테고리의 다른 글

ReadinessProbe,LivenessProbe  (0) 2020.12.01
Lable과 Selector  (0) 2020.12.01
Namespace  (0) 2020.12.01
pod 삭제  (0) 2020.12.01
pod 에 내부 명령 실행과 connect  (0) 2020.12.01

+ Recent posts