Untitled

ex) worker nodes에 gpu=true인 lable만 master node에 요구하여 gpu=true인 것만 실행시켜줌

  이때 값은 key: value 형태로 저장이 됌.

Untitled

답안

  1. kubectl config use-context k8s
  2. kubectl get nodes -L disktype ⇒ DISKTYPE에 존재하는 KEY의 값을 얻을 수 있음
  3. kubectl run eshop-store —image=nginx —dry-run=client -o yaml
  4. kubectl run eshop-store —image=nginx —dry-run=client -o yaml > eshop-store.yaml
  5. ls ⇒ 생성 확인
  6. vi eshop-store.yaml ⇒ spec: 에 넣어기
nodeSelector:
  disktype: ssd

⇒ node selector(검색 시 Assign Pods to Nodes로 접속) → Cretae a pod that gets scheduled to your chosen node에 코드 존재

  1. kubectl apply -f eshop-store.yaml ⇒ 수정된 yaml파일 적
  2. kubectl describe pods eshop-store ⇒ event부분 확인 → started container eshop-store

강의 답안