kubectl-plugins
The following are the kubectl plugins pre-installed in DOK, as well as simple instructions for use.
krew is a tool used to manage kubectl plugins. In addition, krew needs to install tools such as git to use it in an offline environment, so krew may not be very useful in private cluster.
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
This plugin can interactively select the container under the current Namespace to enter in the terminal. In addition, DOK configures an alias for kubectl-iexec, which is kiexec
.
kubectl iexec
kubectl-iexec
kiexec
Through this plugin, you can render the yaml of some commonly used resource objects, which is convenient for local editing and deployment.
kubectl example deploy
kubectl-example pod
This plugin can query PV usage, but there will be some minor problems during installation. If you want to use kubectl df-pv
, you can refer to this [issue](https://github.com/yashbhutwala/kubectl-df -pv/issues/14#issuecomment-1000214876).
df-pv
This plugin mainly depends on the capacity of resources, and can make statistics according to many dimensions, such as Namespace, Node, Pod and so on.
kube-capacity
kube-capacity --available
This plugin can output Pod logs similar to kubectl logs --tail
.
kubectl kail
kubectl-kail
kubectl debug is not a plug-in of kubectl, it belongs to its function (it is indeed a plug-in in the earlier kubectl), which is very useful in the process of debugging. If you are interested, you can learn about the relevant implementation. DOK clusters are temporarily enabled by default. The feature-gate of the container.
kubectl run ephemeral-demo --image=k8s.gcr.io/pause:3.4.1 --restart=Never
kubectl debug -it ephemeral-demo --image=busybox:1.31.1 --target=ephemeral-demo
kubectl run myapp --image=busybox:1.28 --restart=Never -- sleep 1dA
kubectl debug myapp -it --image=ubuntu --share-processes --copy-to=myapp-debug
kubectl debug myapp --copy-to=myapp-debug --set-image=*=ubuntu
kubectl delete pod myapp myapp-debuga
kubectl debug node/mynode -it --image=ubuntu