Reboot coordinator for Fedora CoreOS nodes using the Zincati FleetLock protocol and Hashicorp Vault as backend
- Python 95.5%
- Dockerfile 4.5%
fleetlock-vault
Reboot coordinator for Fedora CoreOS nodes using the Zincati FleetLock protocol and Hashicorp Vault as backend
Configuration
The server is configured using environment variables, the following are supported
HEALTH_CHECK_URLS- Optional - A list of URLs to check before locking, each of which must return 200 in order to lock. This must be formatted as a json-list, for example in bash:export HEALTH_CHECK_URLS='["https://example.com/health"]'`LOG_LEVEL- Optional - The log level to use, one of debug, info, warning or error. Defaults to infoVAULT_ADDR- Required - The address of the vault serverVAULT_TOKEN- Optional - The optional vault token for authentication. Leave this unset if you are for instance using the vault agent in proxy modeVAULT_ACTIVE_NODES- Optional - If this is set, a check is made that at least this number of vault nodes are active in the cluster before lockingVAULT_SECRET_PATH- Optional - The path where the kv2 secret backend is mounted. Defaults tosecretVAULT_SECRET_NAME- Optional - The name of the secret to use for the lock information. Defaults tofleetlock
Vault policy
The server must have access to vault with the following policy (replace VAULT_SECRET_PATH and VAULT_SECRET_NAME with the correct values):
path "VAULT_SECRET_PATH/data/VAULT_SECRET_NAME"
{
capabilities = ["create", "read", "update"]
}
If you are using VAULT_ACTIVE_NODES you also need
path "sys/ha-status"
{
capabilities = ["read"]
}
Development
You should install pre-commit and run pre-commit install
Install uv and run
uv sync --dev
Then to start the server, run
uv run uvicorn --reload app.main:app
Pytest
To run all tests, run
uv run pytest
Using vault dev instance
If you want to test using a development vault instance, start up the vault instance in dev mode and run
vault secrets enable -version=2 kv
export VAULT_ADDR=http://localhost:8200
export VAULT_SECRET_PATH=kv
read -p "vault token?" VAULT_TOKEN
export VAULT_TOKEN
uv run uvicorn --reload app.main:app