https://github.com/gabeduke/civoctl
https://github.com/gabeduke/civoctl
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gabeduke/civoctl
- Owner: gabeduke
- License: mit
- Created: 2020-02-06T18:53:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-12T15:38:50.000Z (over 6 years ago)
- Last Synced: 2025-08-15T05:51:30.993Z (11 months ago)
- Language: Go
- Size: 52.7 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# civoctl
Civoctl is a simple controller to reconcile a list of cluster names with actual k3s clusters in Civo cloud.
Civoctl accepts a yaml list of clusters. As cluster names are added or deleted from the lists, civoctl will create and delete clusters through the Civo API
```yaml
clusters:
- name: civo-1
nodes: 3
- name: civo-2
nodes: 2
```
_Note_: Civoctl will watch the file for changes, any updates made to the configuration file will be realized during the subsequent reconcilliation cycle.
---
[](https://asciinema.org/a/8E4xO0YhHSt3BEbXbbEuZxGxL)
## Usage
### Download
```bash
go get -u github.com/gabeduke/civoctl
```
### Configure
I recommend starting with a list of clusters that already exist in your account. The create loop will be a noop and the delete will not be triggered because the clusters exist.
Civoctl will search in the following places for a config file (named `.civoctl.yaml`)
```bash
# etc
/etc/civoctl/.civoctl.yaml
# home
$HOME/.civoctl.yaml
# current working dir
./.civoctl.yaml
```
Go ahead and stamp the cfg file:
```bash
cat < .civoctl.yaml
clusters:
- name: civo-1
- name: civo-2
EOF
```
### Run
```bash
# export Civo API token (this can also be passed as the cmd line flag --token)
# export CIVO_TOKEN=$(cat /var/secrets/civo_token)
# Show Civoctl help
civoctl --help
# Run the control loop to create clusters
civoctl run
# Run in dangerous mode to also delete clusters
# civoctl run -d
```