GKE 노드 풀 자동 복구 설정 점검

노드 자동 복구와 장애 감시를 함께 구성해 장애가 지속되는 시간을 줄이세요.

설명

GKE는 상태 점검에 계속 실패하는 노드를 자동으로 복구할 수 있습니다. Standard 노드 풀에서 management.auto_repair = true를 설정하세요. Google 제공자의 기본값도 true입니다.

잠재적 영향

복구를 끄면 장애 노드가 운영자의 조치를 기다리며 워크로드 중단이 길어질 수 있습니다. 복구 중 노드가 교체될 때도 워크로드가 일시적으로 중단될 수 있습니다.

해결 방법

적용 후 GKE에서 대상 풀의 자동 복구 설정과 노드 상태를 확인하세요. 노드를 교체해도 워크로드가 실행되도록 구성하고 장애 알림, 수동 복구 절차와 데이터 백업을 유지하세요. 보안 패치는 노드 업그레이드로 적용하세요.

예시

예시는 기본 풀을 제거하고 별도로 만든 my-node-pool에 설정을 적용합니다. 프로젝트, 네트워크, 노드 서비스 계정은 환경에 맞게 지정하세요.

변경 전

hcl
resource "google_container_cluster" "cluster" {
  name                     = "my-gke-cluster"
  location                 = "us-central1"
  remove_default_node_pool = true
  initial_node_count       = 1
}

resource "google_container_node_pool" "node_pool" {
  name       = "my-node-pool"
  location   = "us-central1"
  cluster    = google_container_cluster.cluster.name
  node_count = 1

  management {
    auto_repair = false
  }
}

변경 후

hcl
resource "google_container_cluster" "cluster" {
  name                     = "my-gke-cluster"
  location                 = "us-central1"
  remove_default_node_pool = true
  initial_node_count       = 1
}

resource "google_container_node_pool" "node_pool" {
  name       = "my-node-pool"
  location   = "us-central1"
  cluster    = google_container_cluster.cluster.name
  node_count = 1

  management {
    auto_repair = true
  }
}

참조