Skip to main content

GatewayInstance CRD

The GatewayInstance CRD (charts/stoa-platform/crds/gatewayinstances.gostoa.dev.yaml) declaratively registers an API gateway instance (STOA or third-party) and tracks its reconciliation health through stoa-operator (stoa-operator/src/handlers/gateway_instance.py).

Resource Metadata​

FieldValue
CRD Namegatewayinstances.gostoa.dev
API Versiongostoa.dev/v1alpha1
KindGatewayInstance
Short Namegwi
ScopeNamespaced
Reconcilerstoa-operator (Python/Kopf, Beta)

Operational Example (Reconciled Fields)​

The manifest below includes only the fields forwarded to the Control Plane API by stoa-operator on main (additional schema-validated optional fields such as authConfig.secretRef, endpoints, and topology are listed under Optional Fields):

apiVersion: gostoa.dev/v1alpha1
kind: GatewayInstance
metadata:
name: kong-prod-eu
namespace: stoa-system
spec:
displayName: Kong Production EU
gatewayType: kong
environment: prod
baseUrl: https://kong-admin.internal.example.com:8444
mode: connect

Spec Fields (openAPIV3Schema)​

Required Fields​

The CRD schema enforces four required fields under spec:

FieldTypeEnforced Values / ConstraintsDescription
displayNamestringRequiredHuman-readable display name
gatewayTypestringRequired; Enum: webmethods, kong, apigee, aws_apigateway, gravitee, stoa, stoa_edge_mcp, stoa_sidecar, stoa_proxy, stoa_shadowGateway product/profile identifier
environmentstringRequiredTarget environment identifier (e.g., dev, staging, prod)
baseUrlstringRequiredGateway admin API (or control) base URL
Schema Enum Boundaries & stoa-operator Mapping (gateway_instance.py)
  • Neither spec.gatewayType nor spec.targetGatewayType includes an envoy enum value in the v1alpha1 CRD schema yet (Envoy loopback ADS instances currently register via stoa-connect with STOA_GATEWAY_TYPE=envoy).
  • azure_apim and agentgateway appear in spec.targetGatewayType ([stoa, kong, webmethods, gravitee, agentgateway, apigee, aws_apigateway, azure_apim]) but not in spec.gatewayType.
  • Schema vs operator behavior on main: stoa-operator (_spec_to_registration in stoa-operator/src/handlers/gateway_instance.py) sends only metadata.name, displayName (display_name), gatewayType (gateway_type), baseUrl (base_url), environment, and mode when registering with the Control Plane API. The optional fields below (authConfig.secretRef, tenantId, deploymentMode, targetGatewayType, topology, endpoints, capabilities, version, tags) are validated and stored on the Kubernetes resource by the CRD schema, but are not forwarded to the Control Plane by the Beta operator yet.

Optional Fields​

FieldTypeDefaultEnforced Values / ConstraintsDescription
tenantIdstring—StringOwning tenant ID (omit or leave empty for platform-wide instances)
deploymentModestring—Enum: edge, connect, sidecarCanonical deployment topology
targetGatewayTypestring—Enum: stoa, kong, webmethods, gravitee, agentgateway, apigee, aws_apigateway, azure_apimGateway technology fronted or controlled by STOA
topologystring—Enum: native-edge, remote-agent, same-podExecution topology
topologyProofobject—x-kubernetes-preserve-unknown-fields: trueCo-location/integration evidence object when deploymentMode: sidecar
modestring—Enum: edge-mcp, sidecar, proxy, shadow, connectSTOA gateway runtime mode (ADR-024)
endpointsobject—x-kubernetes-preserve-unknown-fields: true; subfields: publicUrl, targetGatewayUrl, uiUrl, internalUrl, adminUrl, healthUrlLogical endpoint map for the gateway instance
authConfigobject—x-kubernetes-preserve-unknown-fields: trueAdmin API authentication reference (always reference Kubernetes Secrets rather than inline credentials)
capabilitiesstring[][]Array of strings (e.g., rest, graphql, websocket, oidc, rate_limiting, mcp)Declared gateway capabilities
versionstring—StringGateway software version
tagsstring[][]Array of stringsArbitrary labels/tags for filtering

Status Subresource (status)​

FieldTypeEnforced Values / ConstraintsDescription
phasestringEnum: online, offline, degraded, maintenanceReconciled gateway health phase
lastHealthCheckstring—Timestamp of the last successful health check
healthDetailsobjectx-kubernetes-preserve-unknown-fields: trueLast health check payload
errorstring—Error message if the last health check failed

(Implementation note: on main, stoa-operator also attempts to patch status.cpGatewayId — which is not yet declared in status.properties — and writes status.phase: "error" on registration failure, which is rejected by Kubernetes schema validation because error is outside the [online, offline, degraded, maintenance] enum.)

kubectl get gatewayinstances (or kubectl get gwi) displays Type (.spec.gatewayType), Environment (.spec.environment), and Status (.status.phase), plus URL and Topology with -o wide.

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