1、创建镜像拉取的secret
kubectl create secret docker-registry <name> --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL
2、清除Evicted状态的pod
kubectl get pods -n 命名空间 | ``grep` `Evicted | ``awk` `'{print $1}'` `| ``xargs` `kubectl delete pod -n 命令空间
3、清理kubernetes 工作节点node的磁盘空间
docker system prune 清理磁盘,删除关闭的容器、无用的数据卷和网络,以及dangling镜像(即无tag的镜像)
docker system prune -a 处了清除以上内容,还可以清除没有容器使用的镜像。
[root@k8s-pro-node01 /]# docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
Are you sure you want to continue? [y/N] y
Deleted Containers:
6110305e576906c763e9b88df06486ab5ba0b006db9aeccd091fb070852e9813
68df22542dc0489df120e7025e83c39320f4b351a70ac0039ad8595f117cd9cf
3b21c9a82067df2d97b6e6f05504e67d0640543b58fb9c049a196d409f62c56f
376600c5cfdc6649cb38673e9cbd4c73365cc110a34c9045171e006eb8b8d851
58642d0b9879ac4d4dab6e34561cc07e4b8399eed14520f3c2774624cc9ce6ba
7204b1b1d075360974522fc4af5e5faa12aec68b94b9dea4476306caa01ce8f1
b571a6ec7401bd75efc0dc4ff55b256c06ef3014bb6e23b39064a5c5a89689ea
Deleted Images: