kubectl-tools

This is a kubectl toolset that will integrate some useful features in the future

The source code

Github.com/NoBugBoy/ku… A star is not too much

Method of use

Kubernetes version > 1.12 +

Download directly from release github.com/NoBugBoy/ku…

Kubectl-tools executable file in /root/bin directory of k8S cluster master node (Kubectl plugin list)

cd kubernetes
CGO_ENABLED=0 GOOS=linux GOARCH=amd64  go build -o kubectl-tools
Copy the code

Use Kubectl Tools -h to view the help

Currently available features

  1. Debug: provides a container with tools and adds it to the namespace of the target container for diagnosis in the same view. If the target node of debug is operated for the first time, it needs to wait for the image of debug-k8s and the image of the specified Debug Container to be pulled. Repeat if only the Debug Container is changed then only the new tool image is pulled, otherwise there is not much waiting time

  1. Etcd cluster backup only supports kubeadm installation of the cluster, you can run the following command to check whether the CORRESPONDING CM has ETCD configuration information, including CA certificates and nodes
kubectl describe cm kubeadm-config -n kube-system
Copy the code

[root@node0 ~]# kubectl tools backup -o /usr Snapshot saved at /usr/2021.09.03-04:37:56 -etcd-snapsnapshotCopy the code

Debug For details, see aleiwu.com/post/kubect…