gitlab-ci-kubernetes-namespace-cleaner

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0

README

Gitlab CI Kubernetes namespace cleaner

Build status

If you are using Gitlab to automatically deploy to Kubernetes using Gitlab CI and Gitlab environments, you might have noticed that when environments (deployments) are removed, the Namespace resource will stay around forever. Gitlab simply does not remove it (yet). There is an official issue for this that you can find here. Until the issue is resolved, this cleaning tool might help you out! It's a simple tool, written in Golang, that can be deployed to your cluster as a CronJob that removes these stale namespaces on a daily basis.

Note: This will check all namespaces that matches the pattern ^gitlab-ci-test-.+ and has no running pods and delete them. If you have namespaces that matches this pattern that does not run any pods and you want to keep them, do not run this tool.

Building

$ make

Running outside cluster

$ bin/gitlab-ci-kubernetes-namespace-cleaner-linux-amd64 clean --kubeconfig /home/myuser/.kube/config

License

Apache License 2.0 © Anton Johansson

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL