Kubernetes-Deployment-Clean-CronJob 结合Prometheus API 定时清理废弃deployment的任务计划。
The easiest way to install the latest release on Mac or Linux is with the following script:
curl https://glide.sh/get | sh
On Mac OS X you can also install the latest release via Homebrew:
$ brew install glide
On Ubuntu Precise (12.04), Trusty (14.04), Wily (15.10) or Xenial (16.04) you can install from our PPA:
sudo add-apt-repository ppa:masterminds/glide && sudo apt-get update
sudo apt-get install glide
1.安装依赖
make dep
2.构建二进制文件跨平台编译需要指定 mac-build linux-build win-build
make build
你也可以直接make all
, 它包含了dep
和build
构建docker image
, 在此之前你需要安装依赖
make build-docker
清除所有构建内容
make clean
Usage of ./bin/cleanDeployment:
-web_url string
(must)HTTP API URL
web_url
: Prometheus API URL
只能在kubernetes集群内部运行, 如果你需要指定kubeconfig的版本, 那么请看exmple中的cleanDeployment.go
文件