Skip to content

gpsu serve

Control the fans of every server until stopped

Control the fans of every server in gpsu’s database. Serve Prometheus metrics at /metrics, liveness at /healthz, and readiness at /readyz.

Each server’s controller reads its temperatures every interval and picks a fan speed from its policy. It sets that speed within the configured hard limits. When it cannot read the sensors, it hands fan control back to the iDRAC. A temperature past a limit runs the fans at their maximum. On SIGINT or SIGTERM, every server is handed back to the iDRAC before gpsu exits.

Each startup setting comes from its flag, then its GPSU_ environment variable, then its default. Every other setting lives in gpsu’s database. Admins change it in the web UI, the API, or the command line.

With –passive or a server set to passive, gpsu decides and records fan speeds without sending any fan command. It can then run beside another fan controller for comparison.

Usage

gpsu serve [flags]

Examples

# Run with the settings in the environment.
GPSU_PUBLIC_URL=https://gpsu.example.com GPSU_SEAL_KEY_FILE=/run/secrets/seal-key gpsu serve

# Run beside another fan controller without touching any fan.
gpsu serve --public-url http://127.0.0.1:8080 --passive

Flags

FlagTypeDefaultDescription
--backup-dirstring/var/lib/gpsu/backupsdirectory the backups live in ($GPSU_BACKUP_DIR)
--listenstring:8080address of the web UI and the API ($GPSU_LISTEN)
--metrics-listenstring:9465address of /metrics and the health checks ($GPSU_METRICS_LISTEN)
--passivebooldecide and record fan speeds for every server without sending any fan command
--pprof-apiboolserve pprof to admins under the API ($GPSU_PPROF_API)
--pprof-listenstringaddress of pprof without sign-in, or none ($GPSU_PPROF_LISTEN)
--public-urlstringURL users reach gpsu at, such as https://gpsu.example.com ($GPSU_PUBLIC_URL)
--seal-key-filestringfile holding the seal key ($GPSU_SEAL_KEY_FILE)
--seal-key-vaultstringseal key’s key in Vault as [MOUNT:]PATH#KEY ($GPSU_SEAL_KEY_VAULT)
--seal-previous-key-filesstringcomma-separated files holding previous seal keys ($GPSU_SEAL_PREVIOUS_KEY_FILES)
--seal-previous-key-vaultstringcomma-separated previous seal keys’ keys in Vault ($GPSU_SEAL_PREVIOUS_KEY_VAULT)
--store-driverstringsqlitedatabase: sqlite or postgres ($GPSU_STORE_DRIVER)
--store-pathstringSQLite database file (default /var/lib/gpsu/gpsu.db) ($GPSU_STORE_PATH)
--store-uri-filestringfile holding the PostgreSQL connection URI ($GPSU_STORE_URI_FILE)
--store-uri-vaultstringPostgreSQL URI’s key in Vault as [MOUNT:]PATH#KEY ($GPSU_STORE_URI_VAULT)
--trusted-proxiesstringcomma-separated reverse proxies that name the client ($GPSU_TRUSTED_PROXIES)
--vault-addressstringVault’s URL, which turns Vault on ($GPSU_VAULT_ADDRESS)
--vault-allow-httpboolpermit an http:// Vault address ($GPSU_VAULT_ALLOW_HTTP)
--vault-auth-methodstringVault login: kubernetes, jwt, approle, or token ($GPSU_VAULT_AUTH_METHOD)
--vault-auth-mountstringwhere the auth method is mounted ($GPSU_VAULT_AUTH_MOUNT)
--vault-auth-rolestringrole Kubernetes and JWT auth log in as ($GPSU_VAULT_AUTH_ROLE)
--vault-ca-filestringPEM file of the only CA gpsu trusts for Vault ($GPSU_VAULT_CA_FILE)
--vault-namespacestringVault namespace ($GPSU_VAULT_NAMESPACE)
--vault-role-idstringAppRole’s role ID ($GPSU_VAULT_ROLE_ID)
--vault-secret-id-filestringfile holding AppRole’s secret ID ($GPSU_VAULT_SECRET_ID_FILE)
--vault-server-namestringname Vault’s certificate must show ($GPSU_VAULT_SERVER_NAME)
--vault-timeoutstringbound on each request to Vault ($GPSU_VAULT_TIMEOUT)
--vault-token-filestringfile holding the JWT or the Vault token ($GPSU_VAULT_TOKEN_FILE)