Dimios is an application to keep a kubernetes cluster on a clean state based on provided manifests. Those manifests get automatically applied and no longer existing resources are being removed by the application.
To run the tool using our Makefile you need to set a few local environment variables.
This can be done manually or by creating a file called .env
in the projects root directory:
export NAMESPACE=dimios
export MANIFEST_DIR=~/git/k8s/smedia-kubernetes/
If you want to use TeamVault as passwords backend inside templates,
you need to have a file called ~/.teamvault-sm.json
containing your credentials:
{
"url": "https://teamvault.example.com",
"user": "username",
"pass": "password"
}
-dir string : Path to the template/manifest directory
-kubeconfig string : (optional) absolute path to the kubeconfig file (default "~/.kube/config")
-staging : If set the application will run in no-op mode not doing any changes to the cluster
-namespaces string : List of kubernetes namespaces separated by comma
-teamvault-config string : Teamvault config path
-teamvault-pass string
: Teamvault password (if teamvault-config
is unset)
-teamvault-url string
: Teamvault url (if teamvault-config
is unset)
-teamvault-user string
: Teamvault user (if teamvault-config
is unset)
-v value : Log level for glog V logs
-logtostderr : Log to standard error instead of files
-version : Show version info (default false)
-webhook : Start as webserver and sync on each call
-port int : Port webserver listens on
-whitelist string : List of kind to manange separated by comma
All dependencies inside this project are being managed by dep and are checked in.
After pulling the repository, it should not be required to do any further preparations aside from make deps
to prepare the dev tools.
If new dependencies get added while coding, make sure to add them using dep ensure --add "importpath"
.
Feedback and contributions are highly welcome. Feel free to file issues or pull requests.
Simple dryrun
dimios \
-staging \
-dir ~/manifests \
-namespaces download \
-teamvault-config ~/.teamvault.json \
-kubeconfig ~/.kube/config \
-logtostderr \
-v=1
Manange only Services and Deployment with dryrun
dimios \
-staging \
-dir ~/manifests \
-namespaces download \
-teamvault-config ~/.teamvault.json \
-kubeconfig ~/.kube/config \
-logtostderr \
-v=1 \
-whitelist Deployment,Service
Start as webserver on port 9999 with dryrun
dimios \
-staging \
-dir ~/manifests \
-namespaces download \
-teamvault-config ~/.teamvault.json \
-kubeconfig ~/.kube/config \
-logtostderr \
-v=1 \
-port=9999 \
-webhook