Files
nchain/config/crd/bases/nchain.hanzo.ai_gateways.yaml
zeekay 27b0621f5c chore(integration): regen deepcopy+CRDs, converge explorer→indexer endpoint
Regenerate zz_generated deepcopy (controller-gen object) and config/crd/bases
(controller-gen crd) so the merged NodeCluster/Indexer/Explorer/Gateway spec
fields land in the API. Converge the Explorer indexer endpoint onto the
Indexer Service (name={indexer.Name}, port=indexerPortDefault 8091) instead of
the stale {name}-indexer:4000, and update the test.
2026-06-27 21:08:02 +00:00

360 lines
15 KiB
YAML

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
name: gateways.nchain.hanzo.ai
spec:
group: nchain.hanzo.ai
names:
kind: Gateway
listKind: GatewayList
plural: gateways
shortNames:
- gw
singular: gateway
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.nodeClusterRef
name: Cluster
type: string
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .status.readyReplicas
name: Ready
type: integer
- jsonPath: .status.activeRoutes
name: Routes
type: integer
- jsonPath: .status.externalEndpoint
name: Endpoint
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Gateway is the Schema for the gateways API.
It deploys an RPC/API gateway with routing, rate limiting, and load balancing
in front of a NodeCluster.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: GatewaySpec defines the desired state of an RPC/API gateway.
properties:
autoRoutes:
description: |-
AutoRoutes automatically discovers and routes all chains in the referenced NodeCluster.
For the lux protocol this queries the cluster's P-chain (platform.getBlockchains)
and generates a route per non-primary subnet chain.
type: boolean
cors:
description: |-
CORS configures cross-origin resource sharing for all gateway endpoints.
When unset, sensible defaults are applied (origins "*", methods GET/POST/OPTIONS).
properties:
allowedHeaders:
description: AllowedHeaders lists permitted request headers. Defaults
to ["Content-Type","Authorization"].
items:
type: string
type: array
allowedMethods:
description: AllowedMethods lists permitted HTTP methods. Defaults
to ["GET","POST","OPTIONS"].
items:
type: string
type: array
allowedOrigins:
description: AllowedOrigins lists permitted CORS origins. Defaults
to ["*"].
items:
type: string
type: array
type: object
image:
description: |-
Image for the gateway container.
Defaults to ghcr.io/hanzoai/gateway:latest (KrakenD-based).
properties:
pullPolicy:
default: IfNotPresent
description: PullPolicy defines when to pull the image.
enum:
- Always
- IfNotPresent
- Never
type: string
repository:
description: Repository is the container image repository.
type: string
tag:
default: latest
description: Tag is the container image tag.
type: string
required:
- repository
type: object
indexerRefs:
description: IndexerRefs lists Indexer names to expose under /api/indexer/{ref}.
items:
type: string
type: array
ingress:
description: Ingress configures external access to the gateway.
properties:
annotations:
additionalProperties:
type: string
description: Annotations are additional annotations applied to
the Ingress resource.
type: object
clusterIssuer:
default: letsencrypt-prod
description: ClusterIssuer is the cert-manager ClusterIssuer to
use for TLS certificates.
type: string
enabled:
description: Enabled controls whether an Ingress resource is created.
type: boolean
hosts:
description: Hosts lists the hostnames for the Ingress.
items:
type: string
type: array
ingressClassName:
default: ingress
description: IngressClassName specifies the Ingress class to use.
type: string
tls:
default: true
description: TLS enables TLS termination on the Ingress.
type: boolean
type: object
nodeClusterRef:
description: NodeClusterRef is the name of the NodeCluster to route
traffic to.
type: string
rateLimits:
description: |-
RateLimits configures rate limiting applied to RPC endpoints and the
gateway as a whole (KrakenD qos/ratelimit).
properties:
clientMaxRate:
description: ClientMaxRate is the per-client rate limit.
format: int32
minimum: 1
type: integer
every:
description: Every is the time window duration (e.g., "1s", "1m").
type: string
maxRate:
description: MaxRate is the maximum number of requests in the
time window.
format: int32
minimum: 1
type: integer
type: object
replicas:
default: 2
description: Replicas is the number of gateway instances.
format: int32
minimum: 1
type: integer
resources:
description: Resources (CPU/memory) for the gateway containers.
properties:
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Limits describes the maximum amount of compute resources
allowed.
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Requests describes the minimum amount of compute
resources required.
type: object
type: object
routes:
description: Routes defines explicit routing rules.
items:
description: GatewayRoute defines a single route in a Gateway.
properties:
backend:
description: Backend is the service name (or NodeCluster chain
alias) to route to.
type: string
methods:
description: Methods restricts the route to specific HTTP methods.
items:
type: string
type: array
prefix:
description: Prefix is the URL path prefix to match.
type: string
rateLimit:
description: RateLimit overrides the global rate limit for this
route.
properties:
clientMaxRate:
description: ClientMaxRate is the per-client rate limit.
format: int32
minimum: 1
type: integer
every:
description: Every is the time window duration (e.g., "1s",
"1m").
type: string
maxRate:
description: MaxRate is the maximum number of requests in
the time window.
format: int32
minimum: 1
type: integer
type: object
stripPrefix:
description: StripPrefix removes the matched prefix before forwarding.
type: boolean
required:
- backend
- prefix
type: object
type: array
required:
- nodeClusterRef
type: object
status:
description: GatewayStatus defines the observed state of Gateway.
properties:
activeRoutes:
description: ActiveRoutes is the number of routes (gateway endpoints)
currently configured.
format: int32
type: integer
chainRoutes:
additionalProperties:
type: string
description: ChainRoutes maps auto-discovered chain names to their
blockchain IDs.
type: object
conditions:
description: Conditions represent the latest observations of the gateway's
state.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
externalEndpoint:
description: |-
ExternalEndpoint is the externally reachable URL of the gateway, derived
from the configured ingress host when available.
type: string
observedGeneration:
description: ObservedGeneration is the most recent generation observed
by the controller.
format: int64
type: integer
phase:
description: Phase is the current lifecycle phase.
enum:
- Pending
- Creating
- Bootstrapping
- Running
- Degraded
- Deleting
type: string
readyReplicas:
description: ReadyReplicas is the number of gateway replicas that
are ready.
format: int32
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}