검색

10.2.3. NodeMaintenance 사용자 정의 리소스를 사용하여 노드를 유지관리 모드로 설정

download PDF

NodeMaintenance CR(사용자 정의 리소스)을 사용하여 노드를 유지관리 모드에 배치할 수 있습니다. NodeMaintenance CR을 적용하면 허용되는 모든 Pod가 제거되고 노드가 종료됩니다. 제거된 Pod는 클러스터의 다른 노드로 이동하기 위해 대기열에 있습니다.

사전 요구 사항

  • OpenShift Container Platform CLI oc를 설치합니다.
  • cluster-admin 권한이 있는 사용자로 클러스터에 로그인합니다.

절차

  1. 다음 노드 유지관리 CR을 생성하고 파일을 nodemaintenance-cr.yaml로 저장합니다.

    apiVersion: nodemaintenance.kubevirt.io/v1beta1
    kind: NodeMaintenance
    metadata:
      name: maintenance-example  1
    spec:
      nodeName: node-1.example.com 2
      reason: "Node maintenance" 3
    1
    노드 유지관리 CR 이름
    2
    유지관리 모드에 배치할 노드의 이름
    3
    유지 관리 이유에 대한 일반 텍스트 설명
  2. 다음 명령을 실행하여 노드 유지관리 일정을 적용합니다.

    $ oc apply -f nodemaintenance-cr.yaml
  3. 다음 명령을 실행하여 유지관리 작업의 진행 상황을 확인하고 <node-name>을 노드 이름으로 교체합니다.

    $ oc describe node <node-name>

    출력 예

    Events:
      Type     Reason                     Age                   From     Message
      ----     ------                     ----                  ----     -------
      Normal   NodeNotSchedulable         61m                   kubelet  Node node-1.example.com status is now: NodeNotSchedulable

10.2.3.1. 현재 NodeMaintenance CR 작업의 상태 확인

현재 NodeMaintenance CR 작업의 상태를 확인할 수 있습니다.

사전 요구 사항

  • OpenShift Container Platform CLI oc를 설치합니다.
  • cluster-admin 권한이 있는 사용자로 로그인합니다.

절차

  • 다음 명령을 실행하여 현재 노드 유지관리 작업의 상태를 확인합니다.

    $ oc get NodeMaintenance -o yaml

    출력 예

    apiVersion: v1
    items:
    - apiVersion: nodemaintenance.kubevirt.io/v1beta1
      kind: NodeMaintenance
      metadata:
    ...
      spec:
        nodeName: node-1.example.com
        reason: Node maintenance
      status:
        evictionPods: 3   1
        pendingPods:
        - pod-example-workload-0
        - httpd
        - httpd-manual
        phase: Running
        lastError: "Last failure message" 2
        totalpods: 5
    ...

    1
    evictionPods는 제거로 예약된 Pod 수입니다.
    2
    lastError는 최신 제거 오류(있는 경우)를 기록합니다.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.