Kubernetes
How to Upgrade a Kubernetes Cluster
· β˜• 2 min read
The idea of the upgrade is: drain the workloads and take the traffic off, then upgrade the control plane nodes first and the worker nodes afterwards. 1. Check the cluster version 1 2 3 4 kubectl version Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.

How to Inject Environment Variables into a Kubernetes Pod and the Priority Issue
· β˜• 3 min read
1. Several Ways for a Kubernetes Pod to Reference Environment Variables 1.1 Directly Key/Value You can set the Value directly, and you can also use the current Pod’s information as the Value. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 apiVersion: v1 kind: Pod metadata: name: envar-demo labels: purpose: demonstrate-envars spec: containers: - name: envar-demo-container image: gcr.

Add an External DNS Service to a Kubernetes Cluster
· β˜• 2 min read
1. Add DNS to the Host 1.1 CentOS The first method: manage DNS with /etc/resolv.conf Disable NetworkManager If you do not disable NetworkManager, the DNS records you add directly to /etc/resolv.conf are lost after you restart the NetworkManager component. 1 2 3 4 vim /etc/NetworkManager/NetworkManager.conf [main] dns=none Add dns=none to the [main] section.

Several Open-Source Kubernetes Web Management Tools
· β˜• 2 min read
I have recently been researching open-source Kubernetes management platforms. The requirement is to manage hundreds of clusters on an intranet. The functional positioning is to assist operations and provide capabilities to the application layer, rather than serving end users directly. 1. Kubernetes Dashboard Project address: https://github.com/kubernetes/dashboard Tech stack: Angular + Go

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:.