给命令行增加快捷操作提示符
1 | source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell. |
快速删除kubernetes资源
删除Terminating的pods
kubectl get pods --all-namespaces|grep Termi|awk '{print "kubectl -n "$1" delete pods "$2" --force --grace-period=0"}'|xargs -i echo {} >delete.sh
缩容:
kcc scale --current-replicas=3 --replicas=0 deployment/orche
禁止主机调度:
kubectl uncordon NODE_NAME
显示节点ip:
kubectl get nodes -o wide --show-labels|awk '{print $1"\t"$2"\t"$6}'
删除标签:
kubectl label node cnsz12.company.cn bad-
快速启动一个容器:
kc run -i --tty --image harbor.com/library/busybox:1.28.4 dns-test --restart=Never --rm /bin/sh
抓包工具
1 |
|
文件底层无法编辑
chattr
docker 容器网络工具镜像
docker run -ti --net container:a967 nicolaka/netshoot:latest bash