Early development · Kubernetes-native

Any HTTP API.
One Kubernetes controller.

Describe a cloud resource in YAML: its schema and the API calls that read, create, update and delete it. kbridge generates the CRD, reconciles every custom resource, and catches drift. No Go code per provider.

Validate the shipped providers Quick start →
kbridge validate --descriptors providers
kbridge · from descriptor to managed resource

providers/cloudflare/r2-bucket.yaml

apiVersion: kbridge.io/v1alpha1
kind: Resource
metadata:
  name: r2-bucket
spec:
  provider: cloudflare
  crd:
    group: r2.cloudflare.kbridge.io
    version: v1alpha1
    kind: Bucket
    immutable: [name, locationHint, jurisdiction]
    schema:
      type: object
      required: [name]
      properties:
        name:
          type: string
          pattern: '^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$'
        locationHint:
          type: string
          enum: [apac, eeur, enam, weur, wnam, oc]
        jurisdiction:
          type: string
          enum: [default, eu, us, fedramp, fedramp-high]
        storageClass:
          type: string
          enum: [Standard, InfrequentAccess]
  params:
    account: config.accountId
    bucket: spec.name
  headers:
    # Jurisdictional buckets are only reachable through their jurisdiction.
    cf-r2-jurisdiction: spec.?jurisdiction.orValue("default")
  operations:
    read:
      steps:
        - name: get
          method: GET
          path: /accounts/{account}/r2/buckets/{bucket}
          absentOn: [404]
      # The location hint is best effort on Cloudflare's side, so it is never compared.
      observe: >-
        {
          "jurisdiction": steps.get.body.result.jurisdiction,
          "storageClass": steps.get.body.result.storage_class
        }
    create:
      steps:
        - method: POST
          path: /accounts/{account}/r2/buckets
          body: >-
            {
              "name": spec.name,
              ?"locationHint": spec.?locationHint,
              ?"storageClass": spec.?storageClass
            }
      id: spec.name
    update:
      steps:
        - method: PATCH
          path: /accounts/{account}/r2/buckets/{bucket}
          when: '"storageClass" in changed'
          headers:
            cf-r2-storage-class: spec.storageClass
    delete:
      steps:
        - method: DELETE
          path: /accounts/{account}/r2/buckets/{bucket}
          accept: [404]

terminal

$ kbridge gen --descriptors providers | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/buckets.r2.cloudflare.kbridge.io created
$ kubectl apply -f r2-bucket.yaml
bucket.r2.cloudflare.kbridge.io/static created
$ kubectl -n web get buckets.r2.cloudflare.kbridge.io
NAME     READY   SYNCED   EXTERNAL-NAME     AGE
static   True    True     acme-web-static   12s

events

Normal Created · created external object acme-web-static

Warning DriftDetected · fields storageClass differ

The descriptor is the whole integration. The output is a regular Kubernetes resource.

Drift detection

Someone changed it in the console.
You decide what happens next.

Every sync compares the external object with the spec. Each resource picks its policy.

Reapply

default

Reverts changes made outside Kubernetes and recreates deleted objects. The spec stays the source of truth.

Synced · Truedrift reported, then reverted

Alert

Reports the drift with a Kubernetes event, a JSON log line and a Prometheus metric, and leaves the object alone.

Synced · False · Driftedkbridge_resources_drifted = 1

Ignore

Keeps managing the object for your spec changes, without reporting differences made elsewhere.

Synced · True · DriftIgnoredno report

Immutable fields are never changed in place, under any policy. Events and logs name the fields that differ, never their values.

One binary

Every provider runs in the same controller.

kbridge loads the descriptors at startup and starts one controller per resource kind. Adding an API means adding YAML files, not deploying another operator.

  • Rate limit per provider account, shared by every resource that uses it
  • Leader election and per-kind workers for large fleets
  • Descriptors validated and expressions type-checked before anything runs
Descriptor reference →

Declarative

YAML and CEL, not generated code

A descriptor holds the CRD schema, the HTTP calls and a projection of the response. Expressions are type-checked at load time and their cost is bounded.

Write a provider →

Protocols

Speaks the API you already have

JSON or XML bodies. Bearer, header, basic or AWS SigV4 authentication. Several calls per operation, partial updates, retries with backoff.

Provider settings →

Observable

Status you can alert on

Ready and Synced conditions with precise reasons, Kubernetes events, JSON logs, and Prometheus metrics for drift and every API call.

Metrics →

How it works

The descriptor says what.
kbridge makes it so.

1

Describe

A Provider says how to reach the API. A Resource maps a kind to its read, create, update and delete calls.

read:
  steps:
    - name: get
      method: GET
      path: /accounts/{account}/r2/buckets/{bucket}
      absentOn: [404]
2

Generate

kbridge gen prints the CRDs, with immutable fields enforced by the API server, and the minimal RBAC.

$ kbridge gen --descriptors providers \
    --namespace kbridge > generated.yaml
3

Reconcile

kbridge run reads each external object, creates it when absent, converges the fields that differ and reports drift.

$ kbridge run --descriptors /providers \
    --namespace kbridge

Safe by default

Built not to surprise you.

Ownership

No silent adoption

An object that kbridge did not create is never taken over, or deleted, until you name it.

Adoption →

Idempotency

No duplicate creates

A pending-create marker survives crashes. When the outcome is uncertain, kbridge stops instead of guessing.

Interrupted creates →

Secrets

Credentials stay put

Secrets live in the controller namespace. Each ProviderConfig lists the namespaces allowed to use it.

ProviderConfig →

Network

Hosts on a leash

HTTPS only, to allow-listed hosts. Redirects are refused and responses are capped at 4 MiB.

Security model →

Shipped providers

Start with buckets.
Bring any API next.

The descriptors below are the real files that ship with kbridge.

Your API Write a descriptor →
Authentication
AWS SigV4
Encoding
XML
Calls
HEAD and two GETs to read, one PUT per changed setting
apiVersion: kbridge.io/v1alpha1
kind: Resource
metadata:
  name: s3-bucket
spec:
  provider: aws
  crd:
    group: s3.aws.kbridge.io
    version: v1alpha1
    kind: Bucket
    immutable: [name, region]
    schema:
      type: object
      required: [name, region]
      properties:
        name:
          type: string
          # Dotless names keep the virtual-hosted TLS certificate valid.
          pattern: '^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$'
        region:
          type: string
          pattern: '^[a-z]{2}(-[a-z]+)+-[0-9]$'
        versioning:
          type: string
          enum: [Enabled, Suspended]
        tags:
          type: object
          additionalProperties:
            type: string
  endpoint: https://{bucket}.s3.{region}.amazonaws.com
  params:
    bucket: spec.name
    region: spec.region
  authParams:
    service: '"s3"'
    region: spec.region
  operations:
    read:
      steps:
        - name: head
          method: HEAD
          path: /
          absentOn: [404]
        - name: versioning
          method: GET
          path: /?versioning
        - name: tags
          method: GET
          path: /?tagging
          # NoSuchTagSet: the bucket exists but has no tag.
          accept: [404]
      observe: >-
        {
          "region": steps.head.headers["x-amz-bucket-region"],
          "versioning": steps.versioning.body.VersioningConfiguration.?Status.orValue("Suspended"),
          "tags": steps.tags.status == 404
            ? {}
            : toList(steps.tags.body.Tagging.TagSet.Tag).transformMapEntry(i, t, {t.Key: t.Value})
        }
    create:
      steps:
        - method: PUT
          path: /
          # us-east-1 is the default location and rejects an explicit constraint.
          body: >-
            spec.region == "us-east-1"
              ? null
              : dyn({"CreateBucketConfiguration": {"LocationConstraint": spec.region}})
      id: spec.name
    update:
      steps:
        - method: PUT
          path: /?versioning
          when: '"versioning" in changed'
          body: '{"VersioningConfiguration": {"Status": spec.versioning}}'
        - method: PUT
          path: /?tagging
          when: '"tags" in changed && size(spec.tags) > 0'
          body: >-
            {"Tagging": {"TagSet": {"Tag": spec.tags.transformList(k, v, {"Key": k, "Value": v})}}}
        - method: DELETE
          path: /?tagging
          when: '"tags" in changed && size(spec.tags) == 0'
    delete:
      steps:
        - method: DELETE
          path: /
          accept: [404]

FAQ

Questions

Is kbridge a Crossplane provider?

No. kbridge is a standalone controller. It reuses familiar conventions, such as forProvider, a ProviderConfig and an external-name annotation, but needs neither Crossplane nor one binary per provider.

Do I need to write Go to support a new resource?

No. You write a Resource descriptor, and a Provider descriptor if the API is new. kbridge validate checks them, and kbridge gen produces the CRD and RBAC.

What happens when someone edits the resource in the cloud console?

The next sync detects the difference. With Reapply, kbridge reverts it; with Alert, it reports it and leaves the object as is; with Ignore, it stays silent.

Will kbridge take over or delete objects that already exist?

Not unless you ask. An existing object blocks the resource with AlreadyExists until you set the kbridge.io/external-name annotation. deletionPolicy: Orphan keeps the object when the resource is deleted.

How does kbridge authenticate to AWS?

With a Secret holding access keys, IRSA, or EKS Pod Identity, optionally followed by an assumed role for cross-account access. It never falls back to the default credential chain.

Is it ready for production?

Not yet. kbridge is in early development: the shipped descriptors pass the integration tests against API fakes, and have not run against the real APIs yet.

Bring your first API under Kubernetes.

Read how kbridge works, then describe the resource you need.