tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Draining or Cordoning a Node

PDF
Focus Mode
Font Size
Last updated: 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.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback