provider-runtime

module
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0

README

provider-runtime

The Go library every Krateo provider controller is built on: a managed-resource reconciliation runtime over controller-runtime.

Test and coverage

What is this

provider-runtime supplies the generic reconcile loop for managed resources — Observe → Create/Update/Delete against an external system — plus the shared condition model (Ready/Synced), the krateo.io/* annotation vocabulary (external-name, pause, management/deletion policy), OTel-model logging, OTLP metrics, and rate-limiting/workqueue utilities. Providers implement an ExternalClient; the library drives everything else. Consumed as a plain Go module — no image, no chart, no CRDs shipped. Full picture: docs/index.md.

Install

go get github.com/krateo-platformops/provider-runtime@v1.3.0

Configure

See docs/configuration.md. Most used:

Setting Default Effect
reconciler.WithPollInterval 1m Speculative re-observe interval per managed resource
controller.Options.MaxConcurrentReconciles 1 Per-controller worker count
telemetry.Config.Enabled false OTLP metrics pipeline (provider_runtime.* instruments)

Examples

Docs

Develop & release

make test (unit tests, no cluster needed) · make generate (deepcopy) · make lint — release runbook: docs/release.md.

Directories

Path Synopsis
apis
common/v1
Package v1 contains core API types.
Package v1 contains core API types.
examples
greeting-controller command
Command greeting-controller is a minimal, compilable managed-resource controller built on provider-runtime.
Command greeting-controller is a minimal, compilable managed-resource controller built on provider-runtime.
pkg
credentialuse
Package credentialuse holds the Secrets, and the objects that lead to them, that a managed resource reads to reach its external system, for as long as losing them would be unrecoverable.
Package credentialuse holds the Secrets, and the objects that lead to them, that a managed resource reads to reach its external system, for as long as losing them would be unrecoverable.
credentialuse/internal/cutest
Package cutest is the envtest harness for pkg/credentialuse's tests.
Package cutest is the envtest harness for pkg/credentialuse's tests.
errors
Package errors is a github.com/pkg/errors compatible API for native errors.
Package errors is a github.com/pkg/errors compatible API for native errors.
logging
OpenTelemetry-aligned logging for provider-runtime consumers.
OpenTelemetry-aligned logging for provider-runtime consumers.
meta
Package meta contains functions for dealing with Kubernetes object metadata.
Package meta contains functions for dealing with Kubernetes object metadata.
ratelimit
Package ratelimit slows reconciles down automatically when an external API signals a rate limit, per endpoint key, or when the controller's own container is CPU-saturated.
Package ratelimit slows reconciles down automatically when an external API signals a rate limit, per endpoint key, or when the controller's own container is CPU-saturated.
ratelimit/httpsignal
Package httpsignal reports rate-limit signals from HTTP responses, so a provider that talks to GitHub, Azure DevOps or any API using the same headers doesn't rewrite the parsing.
Package httpsignal reports rate-limit signals from HTTP responses, so a provider that talks to GitHub, Azure DevOps or any API using the same headers doesn't rewrite the parsing.
ratelimiter
Package ratelimiter contains suggested default ratelimiters for providers.
Package ratelimiter contains suggested default ratelimiters for providers.
reconciler/reconcilertest
Package reconcilertest helps providers test their ExternalClient against the contracts pkg/reconciler relies on.
Package reconcilertest helps providers test their ExternalClient against the contracts pkg/reconciler relies on.
resource/fake
Package fake provides fake Crossplane resources for use in tests.
Package fake provides fake Crossplane resources for use in tests.
scaletozero
Package scaletozero scales a controller Deployment to zero replicas while the Kind it reconciles has no instances, and back up when an instance appears.
Package scaletozero scales a controller Deployment to zero replicas while the Kind it reconciles has no instances, and back up when an instance appears.
tracing
Package tracing is the API-only half of provider-runtime's OpenTelemetry tracing (docs/design-tracing.md).
Package tracing is the API-only half of provider-runtime's OpenTelemetry tracing (docs/design-tracing.md).

Jump to

Keyboard shortcuts

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