Practice
Common Commands for Cleaning Up Kubernetes Cluster Resources
· ☕ 4 min read
Clusters that run for a long time often face various kinds of resource exhaustion. On top of that, when disk space runs low, Kubelet will proactively clean up images on its own, adding another source of uncertainty. This article provides some command snippets for cleanup work. 1. Cleaning Up Basic Kubernetes Objects Clean up Pods in Evicted state 1 sudo kubectl get pods --all-namespaces -o wide | grep Evicted | awk '{print $1,$2}' | sudo xargs -L1 kubectl delete pod -n Clean up Pods in Error state 1 sudo kubectl get pods --all-namespaces -o wide | grep Error | awk '{print $1,$2}' | sudo xargs -L1 kubectl delete pod -n Clean up Pods in Completed state 1 sudo kubectl get pods --all-namespaces -o wide | grep Completed | awk '{print $1,$2}' | sudo xargs -L1 kubectl delete pod -n Clean up unused PVs 1 sudo kubectl describe -A pvc | grep -E "^Name:.

Kubernetes Complex Stateful Application Management Framework -- Operator
· ☕ 5 min read
1. Origins Originally, two CoreOS employees, in order to make deploying etcd clusters easier, bound corresponding logical operations to the create, delete, and update events of the etcdCluster object, using Kubernetes to automate etcd cluster management. A few months later, at a KubeCon conference, they shared this approach, which they called Operator, and it received a strong response from the community.

Kubernetes' Package Manager -- Helm
· ☕ 3 min read
1. Why Helm Is Needed One important design philosophy in Kubernetes is declarative operation. Users change the system by setting the system’s expected state. For example, the current replica count is 2 and it needs to be adjusted to 3. The declarative way is to modify the replica count in

A Practical Guide to kubectl
· ☕ 5 min read
1. What Is kubectl kubectl is the command-line tool for Kubernetes. It interacts with the cluster through the API server. 2. Configuring kubectl kubectl can be configured through ~/.kube/config to connect to one or more clusters. For details on how to configure it, see: Configure Access to Multiple Clusters. If you need to configure a remote cluster, see: Building a Remote Kubernetes Development Environment.