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
| Field | Value |
|---|---|
| CRD Name | gatewaybindings.gostoa.dev |
| API Version | gostoa.dev/v1alpha1 |
| Kind | GatewayBinding |
| Short Name | gwb |
| Scope | Namespaced |
| Reconciler | stoa-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
| Field | Type | Enforced Values / Constraints | Description |
|---|---|---|---|
apiRef | object | Required (apiRef.name required) | Reference to the Control Plane API catalog entry |
apiRef.name | string | Required | API catalog entry name/identifier |
gatewayRef | object | Required (gatewayRef.name required) | Reference to the target GatewayInstance |
gatewayRef.name | string | Required | Name of the target GatewayInstance |
Optional Fields
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.
| Field | Type | Enforced Values / Constraints | Description |
|---|---|---|---|
apiRef.version | string | String | Specific API version declared in schema (not used in stoa-operator lookup on main) |
gatewayRef.namespace | string | String | Target GatewayInstance namespace declared in schema (not used in stoa-operator lookup on main) |
contractRef | object | Subfields: name (string), namespace (string) | Optional UAC reference declared in schema (not applied by stoa-operator on main) |
desiredState | object | x-kubernetes-preserve-unknown-fields: true | Desired configuration object declared in schema (not applied by stoa-operator on main) |
policies | object[] | Array of {name, type, config} | Binding policies declared in schema (not applied by stoa-operator on main) |
policies[].name | string | String | Policy identifier |
policies[].type | string | String (e.g., rate_limit, cors, request_validation) | Policy type |
policies[].config | object | x-kubernetes-preserve-unknown-fields: true | Policy configuration object |
Status Subresource (status)
| Field | Type | Enforced Values / Constraints | Description |
|---|---|---|---|
syncStatus | string | Enum: pending, syncing, synced, drifted, error, deleting | Synchronization lifecycle state |
actualState | object | x-kubernetes-preserve-unknown-fields: true | State reported back by the target gateway |
gatewayResourceId | string | String | Control Plane deployment ID written by stoa-operator (create_deployment) |
lastSyncAttempt | string | String | Timestamp of the most recent synchronization attempt |
lastSyncSuccess | string | String | Timestamp of the most recent successful synchronization |
syncAttempts | integer | Integer | Cumulative synchronization attempt count |
syncError | string | String | Error 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.
Related Resources
- GatewayInstance CRD — Register target gateway instances
- Multi-Gateway Setup — Multi-gateway orchestration guide
- OPA Policies — Policy authoring guide