A utility to help people working on multiple OpenShift clusters--potentially at the same time.
Build with make.
make clean build
This will create a file ./bin/ocm-workon
.
Copy this onto your $PATH
to run it.
ocm workon
Most arguments can be read from environment variables or via a configuration file located in ${$XDG_CONFIG_DIR:-$HOME/.config}/ocm/workon.yaml
.
While not required, direnv is highly recommended.
Other useful additions are asdf and asdf-direnv.
This is a good starting point if you have zsh installed at /bin/zsh.
cluster_base_directory: /home/geowa4/Clusters
cluster_use_direnv: true
If you only ever work on production clusters, set cluster_production: true
as well.
Before running any other commands it is recommended you initialize the base directory where cluster configurations will be stored. In this directory will be a .zshrc file that you can use to run certain commands when you start working on a cluster.
ocm workon init
Supply one of the ID, external ID, or name of the cluster and a zsh shell will
ocm workon cluster geowa4-test
This will record that you have worked on this cluster in a SQLite database in your cluster base directory. To query that, run the list command.
ocm workon recent
- command to note that the cluster I'm working on should generate a compliance alert
- search for recent clusters worked that I expected to have generated a compliance alert
- truncate clusters worked more than ago and delete their directories
- add options to recent command