incus-ops

module
v0.0.0-...-445e490 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: Apache-2.0

README

incus-ops

Pull-based GitOps and runtime secret injection for IncusOS / Incus. Under development.

The deployment target is Incus 7.7 on Debian 13 with Kairos. IncusOS has a separate compatibility and acceptance path.

One Go binary, three roles: reconcile (COSI), broker (Doppler, isolated Unix sockets), init (startup injection and exec). Native Incus resource types with versioned Kubernetes-style YAML envelopes; no Kubernetes, Compose dependency, host modifications, or external database.

VictoriaMetrics/Grafana, native human OIDC and private MCP portal integration are separate optional workloads/integrations, not required for core runtime. OIDC and MCP are deferred. Real deployment manifests, credentials and network details are private.

incus-ops is licensed under Apache-2.0. The release image carries third-party license notices and source references.

Local tooling and admin client

Install mise, then run mise trust and mise install in this checkout. The Go, native Incus and Doppler clients are version-pinned; mise.lock covers Linux and macOS (amd64/arm64).

The admin helper uses the native client, not the incus-ops runtime binary. Authenticate to Doppler and configure the project/config locally once:

mise exec -- doppler login
mise exec -- doppler setup --project YOUR_ADMIN_PROJECT --config YOUR_CONFIG
mise run incus remote list
mise run incus remote add home https://INCUS_HOST:8443
mise run incus list home:

Verify the server fingerprint when adding a remote. The helper fetches only INCUS_ADMIN_CRT and INCUS_ADMIN_KEY at each invocation, verifies the certificate and matching private key using OpenSSL, and invokes the native client with unchanged arguments and exit status. It requires OpenSSL on PATH. The separate configuration directory defaults to $XDG_CONFIG_HOME/incus-ops/admin (or ~/.config/incus-ops/admin); override with the absolute path in INCUS_ADMIN_CONF. Remote configuration and trusted server certificates persist there. The refreshed PEM files also remain there with owner-only permissions (0600, directory 0700); this is not a memory-only credential helper. Use a dedicated directory, not the standard Incus config. A failed fetch or invalid pair blocks the invocation; do not use the raw client as a fallback to cached credentials. The admin credential must never be readable by the runtime broker. Actual project names, credentials and endpoints are local settings, not repository configuration.

For fully direct argument forwarding, including arguments that mise itself might interpret, use mise exec -- ./scripts/incus-admin .... The unwrapped client remains available through mise exec -- incus ... without fetching credentials.

Test the wrapper without real credentials using mise run test:incus-admin.

Read-only observer

reconcile observe starts the COSI observer and streams coverage changes as JSON. Use a project-restricted client certificate and the independently verified server certificate.

mise exec -- go run ./cmd/incus-ops reconcile observe \
  -endpoint https://INCUS_HOST:8443 -project PROJECT -pool POOL \
  -server-cert server.crt -client-cert client.crt -client-key client.key

Versioned binary

Build the three roles into one binary using the pinned Go toolchain.

mise exec -- ./scripts/build v0.0.0-local bin/incus-ops
bin/incus-ops --version
bin/incus-ops reconcile --help
bin/incus-ops broker --help
bin/incus-ops init --help

CI

GitHub Actions uses the shared Go OCI workflow via the Copier-generated caller. Run mise run check for the template's local Go checks. The OCI binary reports its full source commit with --version. To update the template or workflow, follow the shared repo's existing-project adoption instructions and review the new commit pin in .copier-answers.yml and the caller.

Directories

Path Synopsis
cmd
incus-ops command
experiments
internal
broker
Package broker resolves workload environments through binding-specific handlers.
Package broker resolves workload environments through binding-specific handlers.
gitsource
Package gitsource fetches and validates Git revisions for reconciliation.
Package gitsource fetches and validates Git revisions for reconciliation.
incusapi
Package incusapi exposes the read-only, project-scoped Incus transport used to observe resources.
Package incusapi exposes the read-only, project-scoped Incus transport used to observe resources.
initwrap
Package initwrap validates a launch contract and replaces init with the app.
Package initwrap validates a launch contract and replaces init with the app.
journal
Package journal stores the facts required to recover native Incus operations.
Package journal stores the facts required to recover native Incus operations.
manifest
Package manifest decodes local v1alpha1 desired resources.
Package manifest decodes local v1alpha1 desired resources.
observer
Package observer publishes Incus observations and coverage in COSI.
Package observer publishes Incus observations and coverage in COSI.
ownership
Package ownership computes native changes from desired, last-applied, and freshly read Incus fields.
Package ownership computes native changes from desired, last-applied, and freshly read Incus fields.
policy
Package policy defines the files shared by the reconciler and the broker.
Package policy defines the files shared by the reconciler and the broker.
reconcile
Package reconcile applies native Incus plans through the operation journal.
Package reconcile applies native Incus plans through the operation journal.
telemetry
Package telemetry owns the bounded Prometheus metrics exported by the run roles.
Package telemetry owns the bounded Prometheus metrics exported by the run roles.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL