tencent cloud

Tencent Kubernetes Engine

お知らせ・リリースノート
製品アップデート情報
製品リリース記録
製品の説明
製品の優位性
製品アーキテクチャ
ユースケース
製品機能
リージョンとアベイラビリティーゾーン
クイックスタート
初心者ガイド
標準クラスターのクイック作成
ビギナー向け事例
コンテナアプリケーションのクラウドへのデプロイ Check List
TKE標準クラスターガイド
テンセントクバネティスエンジン
クラスター管理
ネットワーク管理
ストレージ管理
Worker ノードの概要
Kubernetes Object Management
ワークロード
クラウドネイティブサービスガイド
Prometheus監視サービス
TKE Serverlessクラスターガイド
TKE登録クラスターガイド
実践チュートリアル
Serverlessクラスター
ネットワーク
ログ
監視
運用・保守
DevOps
オートスケーリング
よくあるご質問
クラスター類
TKE Serverlessクラスター
運用保守系
サービス類
イメージリポジトリ類
リモート端末類
ドキュメントTencent Kubernetes Engine

Draining or Cordoning a Node

フォーカスモード
フォントサイズ
最終更新日: 2024-12-23 15:29:48

Overview

This document explains how to drain or cordon a node.

Directions

Cordoning a Node

After cordoning a node, new Pods cannot be scheduled to it. If you want to schedule a Pod to the node, you need to uncordon the node manually. If a node has been bound as backend target node, it will be removed from the target node list after it is condoned. You can cordon a node with one of the following two methods:
Method A
Method B
When adding a node, on the CVM Configuration page, click Advanced Settings and select Cordon this node.


1. Log in to the TKE console.
2. In the left sidebar, click Clusters to go to the cluster management page.
3. Click the ID/name of the cluster where to cordon the node to go to the cluster management page as shown below.


4. In the left sidebar, select Node Management > Nodes to go to the Node List page.
5. In the node list, select the row of the node to be cordoned and click Cordon as shown below.


6. In the pop-up dialog box, click OK to complete the cordoning.

Uncordoning a Node

After a node is uncordoned, new Pods can be scheduled to it. You can uncordon a node with one of the following two methods:
Method A
Method B
When you create a node by running a script, you can uncordon it by adding a command for uncordoning the node in the script. Below is an example:
#!/bin/sh
# your initialization script
echo "hello world!"
# If you set unschedulable when you create a node,
# after executing your initialization script,
# use the following command to make the node schedulable.
node=`ps -ef|grep kubelet|grep -oE 'hostname-override=\\S+'|cut -d"=" -f2`
#echo ${node}
kubectl uncordon ${node} --kubeconfig=/root/.kube/config
The kubectl uncordon command indicates uncordoning the node.
1. Log in to the TKE console.
2. In the left sidebar, click Clusters to go to the cluster management page.
3. Click the ID/name of the cluster where to uncordon the node to go to the management page of the cluster. See the figure below:


4. In the left sidebar, select Node Management > Nodes to go to the Node List page.
5. In the node list, select the row of the node to be uncordoned and click Uncordon as shown below.


6. In the pop-up dialog box, click OK to complete the uncordoning.

Draining a Node

Overview

Before performing maintenance on a node, you can safely drain a Pod from a node by draining the node. After the node is drained, all Pods (excluding those managed by DaemonSet) in the node will be automatically drained to other nodes in the cluster, and the drained node will be set to cordoned status.
Note:
For locally stored Pods, data will be lost after they are drained. Please be cautious when doing so.

Directions

1. Log in to the TKE console.
2. In the left sidebar, click Clusters to go to the cluster management page.
3. Click the ID/name of the cluster where to drain the node to go to the management page of the cluster. See the figure below:


4. In the left sidebar, select Node Management > Nodes to go to the Node List page.
5. Click More > Drain in the row of the node to be drained. See the figure below:


6. In the pop-up dialog box, click OK to complete the draining.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック