The simple and easy-to-use program designed to watch user activity and possible orphan clusters for Cloud Providers:
Gardener
GCP (work in progress)
This application is created with a view to using it as the tmux status. To fulfill this criterion the procedure of getting resources from the gardener is separated and is in the second service which serves the UNIX socket that is used by the first one. This architecture allows not to block the main tmux process during calling the right gardener endpoint.
Prerequisites
Installation
Build program:
make build
Add program to PATH and install it as a system agent:
make ln-to-path
make install-agent kubeconfigPath=<KUBECONFIG_PATH> namespace=<NAMESPACE>
NOTE: for local development or need to get more informations from the agent you can pass more arguments to the make install-agent command like: other_flags=--agentVerbose.
Check if program works by getting its logs:
tail /tmp/cloud-agent.stdout
After waiting ~60 seconds for first iteration of the watcher you can get cluster state:
cloudagent state --createdBy <OWNER_NAME>
Un-installation
Remove application from path and remove system agent:
make rm-from-path
make uninstall-agent
Integration with tmux
To add this application to tmux put line below in the ~/.tmux.conf file:
set -ag status-right ' #(cloudagent state --createdBy <OWNER_NAME> -o text) '