Skip to main content

GatewayBinding CRD

The GatewayBinding CRD (charts/stoa-platform/crds/gatewaybindings.gostoa.dev.yaml) declaratively binds an API catalog entry (and optional UAC contract and inline policies) onto a target GatewayInstance. It is reconciled by stoa-operator (stoa-operator/src/handlers/gateway_binding.py).

Resource Metadata​

FieldValue
CRD Namegatewaybindings.gostoa.dev
API Versiongostoa.dev/v1alpha1
KindGatewayBinding
Short Namegwb
ScopeNamespaced
Reconcilerstoa-operator (Python/Kopf, Beta)

Operational Example (Reconciled Fields)​

The manifest below includes only the fields reconciled by stoa-operator on main (additional schema-validated optional fields are listed under Optional Fields):

apiVersion: gostoa.dev/v1alpha1
kind: GatewayBinding
metadata:
name: payments-on-kong-eu
namespace: tenant-acme
spec:
apiRef:
name: payments-api
gatewayRef:
name: kong-prod-eu

Spec Fields (openAPIV3Schema)​

Required Fields​

FieldTypeEnforced Values / ConstraintsDescription
apiRefobjectRequired (apiRef.name required)Reference to the Control Plane API catalog entry
apiRef.namestringRequiredAPI catalog entry name/identifier
gatewayRefobjectRequired (gatewayRef.name required)Reference to the target GatewayInstance
gatewayRef.namestringRequiredName of the target GatewayInstance

Optional Fields​

Schema vs stoa-operator Behavior (gateway_binding.py)

On current main, on_gwb_create (stoa-operator/src/handlers/gateway_binding.py) resolves only spec.apiRef.name (catalog_id) and spec.gatewayRef.name (gateway_id) against the Control Plane API (apiRef.version and gatewayRef.namespace are not used during lookup), does not apply contractRef, desiredState, or policies, and calls cp_client.create_deployment(catalog_id, [gateway_id]) (cp_client.py) whose returned deployments[0]["id"] is written into status.gatewayResourceId.

FieldTypeEnforced Values / ConstraintsDescription
apiRef.versionstringStringSpecific API version declared in schema (not used in stoa-operator lookup on main)
gatewayRef.namespacestringStringTarget GatewayInstance namespace declared in schema (not used in stoa-operator lookup on main)
contractRefobjectSubfields: name (string), namespace (string)Optional UAC reference declared in schema (not applied by stoa-operator on main)
desiredStateobjectx-kubernetes-preserve-unknown-fields: trueDesired configuration object declared in schema (not applied by stoa-operator on main)
policiesobject[]Array of {name, type, config}Binding policies declared in schema (not applied by stoa-operator on main)
policies[].namestringStringPolicy identifier
policies[].typestringString (e.g., rate_limit, cors, request_validation)Policy type
policies[].configobjectx-kubernetes-preserve-unknown-fields: truePolicy configuration object

Status Subresource (status)​

FieldTypeEnforced Values / ConstraintsDescription
syncStatusstringEnum: pending, syncing, synced, drifted, error, deletingSynchronization lifecycle state
actualStateobjectx-kubernetes-preserve-unknown-fields: trueState reported back by the target gateway
gatewayResourceIdstringStringControl Plane deployment ID written by stoa-operator (create_deployment)
lastSyncAttemptstringStringTimestamp of the most recent synchronization attempt
lastSyncSuccessstringStringTimestamp of the most recent successful synchronization
syncAttemptsintegerIntegerCumulative synchronization attempt count
syncErrorstringStringError message from the most recent failed synchronization

kubectl get gatewaybindings (or kubectl get gwb) displays API (.spec.apiRef.name), Gateway (.spec.gatewayRef.name), Sync (.status.syncStatus), and Age.

Cookies and privacy

With your permission, we use cookies to measure visits and understand navigation to improve the site.

Learn more

Google Analytics measures visits and useful clicks. Microsoft Clarity provides masked interaction replays. No advertising use. Your choice is saved for six months. You can change or withdraw it at any time using the “Cookies” button.

Read the audience measurement details