이 문서에서는 클러스터 노드 드레이닝이 포드 중단 예산(PDB)를 위반할 경우를 대비해서 제한 시간 값을 구성하는 방법을 보여줍니다.
노드가 드레이닝될 때는 해당 노드의 모든 포드를 종료해야 합니다. 기본적으로 포드 종료로 PDB가 위반될 경우 노드 드레이닝이 차단됩니다.
일부 경우에는 노드 드레이닝이 PDB 위반에 따라 차단될 수 있는 최대 시간을 구성해야 할 수 있습니다. 예를 들어 클러스터 업데이트 또는 업그레이드를 시작하기 전 제한 시간 값을 구성해야 할 수 있습니다.
또는 PDB 위반에 따라 현재 드레이닝이 차단되는 노드에 대해 제한 시간 값을 구성해야 할 수 있습니다.
제한 시간 값 설정
각 노드는 머신 객체로 제공됩니다.
클러스터의 머신 객체를 나열합니다.
kubectl --kubeconfig CLUSTER_KUBECONFIG get machines
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document shows how to configure a timeout value in case the draining of a\ncluster node is in violation of a Pod disruption budget (PDB).\n\nWhen a node is drained, all Pods on the node must be terminated. By default, if\nthe termination of a Pod is in violation of a PDB, the draining of the node is\nblocked.\n\nIn some situations, you might want to configure a maximum time that the\ndraining of a node can be blocked by a PDB violation. For example, you might\nwant to configure a timeout value before you start a cluster update or upgrade.\nOr you might need to configure a timeout value for a node that is currently\nblocked from draining by a PDB violation.\n\nSet a timeout value\n\nEach node is represented by a Machine object.\n\nList the Machine objects in the cluster:\n\n```\nkubectl --kubeconfig CLUSTER_KUBECONFIG get machines\n```\n\nReplace \u003cvar translate=\"no\"\u003eCLUSTR_KUBECONIFG\u003c/var\u003e with the path of the cluster kubeconfig\nfile.\n\nExample output:\n\n```\nmy-node-pool-7f864959cd-cw472\nmy-node-pool-7f864959cd-kh86m\nmy-node-pool-7f864959cd-wtpvx\n```\n\nOpen a Machine object for editing:\n\n```\nkubectl --kubeconfig CLUSTER_KUBECONFIG edit machine MACHINE_NAME\n```\n\nReplace \u003cvar translate=\"no\"\u003eMACHINE_NAME\u003c/var\u003e with the name of the Machine object.\n\nIn the editor, add this annotation:\n\n```\nonprem.cluster.gke.io/pdb-violation-timeout: TIMEOUT\n```\n\nReplace \u003cvar translate=\"no\"\u003eTIMEOUT\u003c/var\u003e with a string that specifies the duration of the\ntimeout. Valid time units are \"s\", \"m\", \"h\". Examples of time values are \"1h\",\n\"1h30m\", \"10m\", and \"100s\".\n\nIf you set the timeout value to \"0s\", then PDB violations will never time out.\nThis is the same as the default behavior.\n\nExample:\n\n```\napiVersion: cluster.k8s.io/v1alpha1\nkind: Machine\nmetadata:\n annotations:\n kubelet-version: 1.23.5-gke.1502\n onprem.cluster.gke.io/gke-on-prem-version: 1.12.0-gke.430\n vm-ip-address: 203.0.113.2\n onprem.cluster.gke.io/pdb-violation-timeout: \"5m\"\n```\n\nClose the editing session.\n\nRolling updates\n\nDuring a rolling update, a new surge machine is created first. Then the old node\nis drained, and after all the Pods on it have been evicted, the old Machine\nobject and Node object are both deleted. The PDB violation timeout annotation\ndoes not persist on the newly created Machine object."]]