update kuber doc

This commit is contained in:
2025-06-29 16:56:28 +03:30
parent 9f661b1335
commit 64af745244
3 changed files with 155 additions and 29 deletions

View File

@@ -1,44 +1,63 @@
# 🌐 Node Management with Kubernetes
## Node Management
Efficient management of Kubernetes nodes ensures cluster stability and workload flexibility. Below are key commands for listing and maintaining nodes.
### Listing Nodes
---
- **Show All Nodes**
## 📋 Listing Nodes
### 🔹 Show All Nodes
```bash
kubectl get nodes
````
### 🔹 Show Nodes with Labels
```bash
kubectl get nodes --show-labels
```
---
## 🔧 Node Maintenance (Cordon / Drain)
### 🚫 Cordon a Node
Prevent new pods from being scheduled on the node.
```bash
kubectl cordon <node-name>
```
### ✅ Uncordon a Node
Mark the node as schedulable again.
```bash
kubectl uncordon <node-name>
```
### 🧹 Drain a Node
Evict all pods from the node (excluding those managed by DaemonSets).
* Forcefully drain the node:
```bash
kubectl get nodes
kubectl drain <node-name> --ignore-daemonsets --force
```
```bash
kubectl get nodes --show-lables
```
### Node Maintenance (Cordon/Drain)
- **Cordon a Node**
Prevent new pods from being scheduled on the node.
```bash
kubectl cordon <node-name>
```
- **Uncordon a Node**
Mark the node as schedulable again.
```bash
kubectl uncordon <node-name>
```
- **Drain a Node**
Evict all pods from the node (excluding those managed by DaemonSets).
* Drain and delete local data:
```bash
kubectl drain <node-name> --ignore-daemonsets --delete-local-data
```
> **Warning:** Draining a node will evict running pods. Ensure that you plan this action to avoid service disruption.
#### 🔄 Undo Drain (Uncordon)
```bash
kubectl uncordon <node-name>
```
---
> ⚠️ **Warning:** Draining a node will evict running pods. Ensure that this is planned to avoid service disruption.