- Documentation
Volcengine Kubernetes Engine
Volcengine Kubernetes Engine
User guide
Clusters
Cluster O&M
ETCD cleanup
ETCD cleanup
Cleaning up resource objects and ETCD fragments that are no longer used in the cluster can reduce storage pressure and its impact on the cluster control plane. This topic describes the applicable scenarios, precautions, and operation methods for ETCD data cleanup and defragmentation.
ETCD is used to store resource objects and state data of a Kubernetes cluster. As the cluster scale expands and resource objects change frequently, fragmented space and resource objects no longer used by the business may gradually accumulate in ETCD. This causes the database file to grow, storage pressure to rise, and database read/write and maintenance overhead to increase. To address these two issues, ETCD O&M mainly includes the following two aspects:
- ETCD defragmentation: After Kubernetes resources are frequently created, updated, and deleted, and data compaction is performed, reclaimable fragmented space that has not been returned to the disk is generated in ETCD. Long-term accumulation of fragments causes the ETCD database file to continuously grow, increasing disk I/O and database read/write and maintenance overhead. In large-scale clusters or scenarios with high-frequency resource changes, excessive fragments may also increase the request latency of the Kubernetes API Server and affect the stability of the cluster control plane.
- ETCD data cleanup: During business iterations, configuration changes, and task execution, Kubernetes resource objects that are no longer used may accumulate in the cluster, such as ConfigMaps, Secrets, and Pods. These objects are still stored as valid data in ETCD and continuously occupy storage space. You can identify and delete resource objects that are no longer needed based on the number of resource objects, occupied size, and business dependencies. This reduces the amount of ETCD data from the source and lowers storage and read/write pressure.
- Defragmentation is an ETCD maintenance operation. During execution, extra disk I/O and short-term performance overhead may occur. Avoid performing this operation during business peak hours.
- Before execution, confirm that the cluster is running stably to prevent the defragmentation task from coinciding with other control plane exceptions.
- In the left navigation pane, click Cluster. Click the name of the target cluster to go to the management page of this cluster.
- In the left navigation pane, click O&M center > Cluster jobs.
- Click Create Job, select ETCD defragmentation from the drop-down list, and initiate the task as prompted.
- After defragmentation is complete, you can view the task status on the Cluster jobs page. When the task status changes to Success, it indicates that the task is complete.
- After defragmentation is complete, you can view the ETCD capacity of the cluster through the etcd monitoring dashboard in the Cloud native observability module. Compare the ETCD database file size before and after task execution, and confirm the cleanup result. For details, see Control plane service observability.
- Deleting Kubernetes resource objects may affect running workloads or related business. Before performing cleanup, confirm that the target resources are no longer in use and evaluate the impact of the deletion operation.
- Do not delete resources directly based only on the size of resource objects. You need to determine whether they can be cleaned up based on the object purpose, namespace, and business dependencies.
- A Secret may contain credentials or configuration required for workload operation, and a ConfigMap may be referenced by a Pod or controller. Before deleting resources, confirm that no valid references exist.
- In the left navigation pane, click Cluster. Click the name of the target cluster to go to the management page of this cluster.
- In the left navigation pane, click Overview. On the Overview page, click the Control plane observability tab.
- On the resource object size dashboard in the Monitoring of cluster resources and control plane services section, analyze the size and quantity of different Kubernetes resource objects.
- Based on business usage, identify Kubernetes resource objects that are no longer needed, such as ConfigMaps, Secrets, and Pods.
- Go to the management page of the corresponding resource object, verify the resource name, namespace, and business dependencies, and delete the resource objects that you no longer need.
Last updated: 2026.10.20 14:03:08