The simple and easy-to-use program is 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.
Installation
Verify and build the program:
make verify
make build
Create configuration file (see also) in the ${HOME}/.cloudagent.conf.yaml location.
Add the program to PATH and install it as a system agent:
make ln-to-path
make install-agent
NOTE: for local development or need to get more information from the agent you can pass more arguments to the make install-agent command like: other_flags=--agentVerbose.
Check if the program works by getting its logs:
tail /tmp/cloudagent.stdout
After waiting ~60 seconds for the first iteration of the watcher you can get the cluster state:
cloudagent state
Un-installation
Remove the application from the 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) '