본문 바로가기
cloud/k8s(문제풀이)

[cka]kodekloud-Multiple Schedulers

by mozi2 2022. 6. 13.
반응형

1. What is the name of the POD that deploys the default kubernetes scheduler in this environment?

# k get pods
# k get pods -ALL

A) kube-scheduler-controlplane 

 

2.What is the image used to deploy the kubernetes scheduler?

   Inspect the kubernetes scheduler pod and identify the image

# k describe pod kube-scheduler-controlpane -n kube-system

3.We have already created the ServiceAccount and ClusterRoleBinding that our custom scheduler will make use of.

Checkout the following Kubernetes objects:

ServiceAccount: my-scheduler (kube-system namespace)
ClusterRoleBinding: my-scheduler-as-kube-scheduler
ClusterRoleBinding: my-scheduler-as-volume-scheduler

Run the command: kubectl get serviceaccount -n kube-system & kubectl get clusterrolebinding
Note: - Don't worry if you are not familiar with these resources. We will cover it later on.

# k get clusterrolebinding

: 이 문제는 해당 요건에 맞게 serviceAccount 와 clusterRoleBinding 에서 스케줄이 잘 되었는지 확인하는 부분이다. 

: 해당 명령어 확인만 하고 넘어가면 됩니다

4. Let's create a configmap that the new scheduler will employ using the concept of ConfigMap as a volume. Create a configmap with name my-scheduler-config using the content of file /root/my-scheduler-config.yaml

# ls 
# cat my-scheduler-config.yaml
# k create configmap my-scheduler-config --from-file=/root/my-scheduler-config.yaml
# k get configmaps my-scheduler-config -n kube-system

5.Deploy an additional scheduler to the cluster following the given specification.

  Use the manifest file provided at /root/my-scheduler.yaml. Use the same image as used by the default kubernetes scheduler.

  • Name: my-scheduler

  • Status: Running

  • Correct image used?

# cat ./my-scheduler.yaml
  : 다른 요건은 맞지만, 이미지가 없음을 확인 
# k get pods -A
# k describe pod kube-scheduler-controlplane -n kube-system | grep Image
# k describe pod kube-apiserver-controlplane -n kube-system | grep Image
  : 현재 running 중인 pod의 이미지를 가져오자 

# vi my-scheduler.yaml
# k create -f my-scheduler.yaml
# k get pods -A

 : 이미지를 넣은 yaml 을 배포한다. 

6.A POD definition file is given. Use it to create a POD with the new custom scheduler.

   File is located at /root/nginx-pod.yaml

# vi nginx-pod.yaml
# k create -f nginx-pod.yaml
# k get pods

 : schedulerName 이름을 추가한다. 

728x90
반응형

'cloud > k8s(문제풀이)' 카테고리의 다른 글

[cka]kodekloud-Managing Application Logs  (0) 2022.06.13
[cka]kodekloud-Monitor Custer Components  (0) 2022.06.13
[cka]kodekloud-static pods  (0) 2022.06.13
[cka]kodekloud-DaemonSets  (0) 2022.06.09
[cka]kodekloud-Resources Limit  (0) 2022.06.09