kubectl run —restart=Never —image=busybox static-busybox —dry-run -o yaml —command sleep 1000

'나는 노동자 > EXAM' 카테고리의 다른 글

Static Pods  (0) 2019.10.25
labels and selectors  (0) 2019.10.25
Taint and Tolerations  (0) 2019.10.24

Without kube-apiserver

Worker node의 /etc/kubernetes/manifests 에 pod.yaml(이름 상관없어요 그냥 yaml file)을 만들어 주면 된다

manifests가 없다면 만들어 주자

kubelet.service의 내용을 보면(systemctl status kubelet)
—pod-manifest-path=/etc/kuberbets/manifests
—config=kubeconfig.yaml <== 해당 경로를 넣어줌

kubeconfig.yaml파일의 내용
staticPodPath: /etc/kubernetes/manifests

docker ps 로 컨테이너가 만들어졌는지 확인
kubectl get pods <= 만들어졌는지 확인

삭제가 되지 않으며 ,해당 노드에 가서 manifests 안의 파일을 삭제해야한다

보틍은 master node 의 /etc/kubernetes/manifests 안에
controller-manager.yaml , apiservcer.yam, etcd,yaml
이 들어있어서 항상 동작하도록(삭제되지 않고) 하는데 사용됨

staticpods 는 created by kubelet
Daemonsets은 created by kube-apiserver(daemonset controller)

​​static pod가 만약 node01에서 실행되고 있고 이를 삭제하고 자 할때

kubectl get nodes -o wide
ssh node01

cat /var/lib/kubelet/config

manifest path를 찾기위해 위의 cat 명령어를 실행

해당 파일을 보면
staticPodPath: ~
가 나온다 해당 경로에 가서 삭제해주면 된다




'나는 노동자 > EXAM' 카테고리의 다른 글

kubectl run  (0) 2019.10.25
labels and selectors  (0) 2019.10.25
Taint and Tolerations  (0) 2019.10.24

We have deployed a number of pods they are labelled with tier ,env, and bu how many pods exits in the dev environment

Use selectors to filter the output

kubectl get pods —selector env=dev

How many pods are in the fiance busiess unit(bu)?

kubectl get pods —selector bu=finance

How many objects are in the ‘prod’ environment including PODs, ReplicasSets and anby other objects?

kubectl get all —selector env=prod


Identify the pod which is ‘prod’ , part of ‘finance’ BU and is a ‘frontend’ tier?

kubectl get all —selector env=prod,bu=finance,tier=frontend

'나는 노동자 > EXAM' 카테고리의 다른 글

kubectl run  (0) 2019.10.25
Static Pods  (0) 2019.10.25
Taint and Tolerations  (0) 2019.10.24

NoSchedule 의 경우 tolerations이 없는 경우 해당 노드에 할당되지 못하며

 toleration effect가 NoExecute인 경우는 taint가 적용되지 않은

노드에 할당된다

 

taint확인

 $ kubectl describe node node01 |grep -i taint

taint 만들기

key: spray    value: mortein    effect: NoSchedle

 

master $ kubectl taint node node01 spray=mortein:NoSchedule
node/node01 tainted

 

taint 제거

master $ kubectl taint node node01 spray-
node/node01 untainted

 

master $ kubectl describe node master |grep -i taint
Taints:             node-role.kubernetes.io/master:NoSchedule

 

taint해제

kubectl taint nodes master node-role.kubernetes.io/master:NoSchedule-

'나는 노동자 > EXAM' 카테고리의 다른 글

kubectl run  (0) 2019.10.25
Static Pods  (0) 2019.10.25
labels and selectors  (0) 2019.10.25

+ Recent posts