* Update to Outdated files in the dev-1.18-ko.1 branch (#19886) * Translate reference/glossary/service-catalog.md in Korean (#20055) * Translate storage/dynamic-provisioning.md in Korean (#19952) * Translate extend-kubernetes/extend-cluster.md in Korean (#20031) * Translate storage/persistent-volumes.md in Korean (#19906) * Translate partners/_index.html in Korean (#19967) * Translate extend-kubernetes/operator.md in Korean (#20037) * Translate assign-pods-nodes to Korean (#20035) * Translate scheduling/kube-scheduler.md in Korean (#19879) * Translate concepts/containers/overview in Korean (#19885) * Translate policy/pod-security-policy.md in Korean (#19922) * Translate policy/limit-range.md in Korean (#19912) * Translate policy/resource-quotas.md in Korean (#19931) * Translate extend-kubernetes/api-extension/custom-resources.md in Korean (#20093) * Translate reference/glossary/managed-service.md in Korean (#20150) Co-authored-by: Jerry Park <jaehwa@gmail.com> Co-authored-by: heechang lee <bluefriday86@gmail.com> Co-authored-by: Yuk, Yongsu <ysyukr@gmail.com> Co-authored-by: Seokho Son <shsongist@gmail.com> Co-authored-by: coolguyhong <podolsmith@naver.com> Co-authored-by: santachopa <santachopa@naver.com> Co-authored-by: Jesang Myung <jesang.myung@gmail.com> Co-authored-by: June Yi <june.yi@samsung.com>
3.1 KiB
title, content_template, weight
| title | content_template | weight |
|---|---|---|
| 노드에 파드 할당 | templates/task | 120 |
{{% capture overview %}} 이 문서는 쿠버네티스 클러스터의 특정 노드에 쿠버네티스 파드를 할당하는 방법을 설명한다. {{% /capture %}}
{{% capture prerequisites %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
노드에 레이블 추가
-
클러스터의 {{< glossary_tooltip term_id="node" text="노드" >}}를 레이블과 함께 나열하자.
kubectl get nodes --show-labels결과는 아래와 같다.
NAME STATUS ROLES AGE VERSION LABELS worker0 Ready <none> 1d v1.13.0 ...,kubernetes.io/hostname=worker0 worker1 Ready <none> 1d v1.13.0 ...,kubernetes.io/hostname=worker1 worker2 Ready <none> 1d v1.13.0 ...,kubernetes.io/hostname=worker2 -
노드 한 개를 선택하고, 레이블을 추가하자.
kubectl label nodes <your-node-name> disktype=ssd<your-node-name>는 선택한 노드의 이름이다. -
선택한 노드가
disktype=ssd레이블을 갖고 있는지 확인하자.kubectl get nodes --show-labels결과는 아래와 같다.
NAME STATUS ROLES AGE VERSION LABELS worker0 Ready <none> 1d v1.13.0 ...,disktype=ssd,kubernetes.io/hostname=worker0 worker1 Ready <none> 1d v1.13.0 ...,kubernetes.io/hostname=worker1 worker2 Ready <none> 1d v1.13.0 ...,kubernetes.io/hostname=worker2위의 결과에서,
worker0노드에disktype=ssd레이블이 있는 것을 확인할 수 있다.
선택한 노드에 스케줄되도록 파드 생성하기
이 파드 구성 파일은 disktype: ssd라는 선택하는 노드 셀렉터를 가진 파드를
설명한다.
즉, disktype=ssd 레이블이 있는 노드에 파드가 스케줄될 것이라는
것을 의미한다.
{{< codenew file="pods/pod-nginx.yaml" >}}
-
구성 파일을 사용해서 선택한 노드로 스케줄되도록 파드를 생성하자.
kubectl apply -f https://k8s.io/examples/pods/pod-nginx.yaml -
파드가 선택한 노드에서 실행 중인지 확인하자.
kubectl get pods --output=wide결과는 아래와 같다.
NAME READY STATUS RESTARTS AGE IP NODE nginx 1/1 Running 0 13s 10.200.0.4 worker0
특정 노드에 스케줄되도록 파드 생성하기
nodeName 설정을 통해 특정 노드로 파드를 배포할 수 있다.
{{< codenew file="pods/pod-nginx-specific-node.yaml" >}}
설정 파일을 사용해 foo-node 노드에 파드를 스케줄되도록 만들어 보자.
{{% /capture %}}
{{% capture whatsnext %}}