Skip to content

Commit dc542dc

Browse files
stubbiclaude
andcommitted
feat(api): add spec.networking.httpRoute to HermesInstance
Mirror the IngressSpec shape with an optional Gateway API HTTPRoute: parentRefs, hostnames, path, servicePortName and annotations. Add the HTTPRouteReady condition type. Regenerate deepcopy, the CRD (config + Helm chart copy) and the generated API reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b195df7 commit dc542dc

5 files changed

Lines changed: 289 additions & 0 deletions

File tree

api/v1/hermesinstance_types.go

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,63 @@ type NetworkingSpec struct {
449449
// Ingress controls optional Ingress creation.
450450
// +optional
451451
Ingress IngressSpec `json:"ingress,omitempty"`
452+
453+
// HTTPRoute controls optional Gateway API HTTPRoute creation. The operator
454+
// emits an unstructured gateway.networking.k8s.io/v1 HTTPRoute; the Gateway
455+
// API CRDs must be installed in the cluster for this to take effect.
456+
// +optional
457+
HTTPRoute *HTTPRouteSpec `json:"httpRoute,omitempty"`
458+
}
459+
460+
// HTTPRouteSpec controls optional Gateway API HTTPRoute creation. It mirrors the
461+
// IngressSpec shape for consistency: a single prefix rule routing to the agent
462+
// Service. The route is only created when Enabled is true.
463+
type HTTPRouteSpec struct {
464+
// Enabled: when true, the operator creates an HTTPRoute for the agent.
465+
// Default false.
466+
// +kubebuilder:default=false
467+
// +optional
468+
Enabled *bool `json:"enabled,omitempty"`
469+
470+
// ParentRefs are the Gateways (or other parents) this route attaches to.
471+
// At least one is required for the route to take effect.
472+
// +optional
473+
ParentRefs []HTTPRouteParentRef `json:"parentRefs,omitempty"`
474+
475+
// Hostnames are the hostnames matched by this route.
476+
// +listType=set
477+
// +optional
478+
Hostnames []string `json:"hostnames,omitempty"`
479+
480+
// Path is the path prefix routed to the agent Service. Default "/".
481+
// +kubebuilder:default="/"
482+
// +optional
483+
Path string `json:"path,omitempty"`
484+
485+
// ServicePortName: name of the Service port the route should target.
486+
// Default "gateway".
487+
// +kubebuilder:default="gateway"
488+
// +optional
489+
ServicePortName string `json:"servicePortName,omitempty"`
490+
491+
// Annotations are applied verbatim onto the HTTPRoute.
492+
// +optional
493+
Annotations map[string]string `json:"annotations,omitempty"`
494+
}
495+
496+
// HTTPRouteParentRef references a parent (typically a Gateway) the route attaches to.
497+
type HTTPRouteParentRef struct {
498+
// Name of the parent resource (e.g. the Gateway name).
499+
// +kubebuilder:validation:MinLength=1
500+
Name string `json:"name"`
501+
502+
// Namespace of the parent. Defaults to the HermesInstance namespace when empty.
503+
// +optional
504+
Namespace *string `json:"namespace,omitempty"`
505+
506+
// SectionName is the name of a section within the parent (e.g. a Gateway listener).
507+
// +optional
508+
SectionName *string `json:"sectionName,omitempty"`
452509
}
453510

454511
// ServiceSpec controls the agent's Service.
@@ -1057,6 +1114,7 @@ const (
10571114
ConditionTypePDBReady = "PDBReady"
10581115
ConditionTypeHPAReady = "HPAReady"
10591116
ConditionTypeIngressReady = "IngressReady"
1117+
ConditionTypeHTTPRouteReady = "HTTPRouteReady"
10601118
ConditionTypeServiceMonitorReady = "ServiceMonitorReady"
10611119
ConditionTypePrometheusRuleReady = "PrometheusRuleReady"
10621120
ConditionTypeGrafanaDashboardReady = "GrafanaDashboardReady"

api/v1/zz_generated.deepcopy.go

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/hermes-operator/templates/crds/hermes.agent_hermesinstances.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,6 +4641,66 @@ spec:
46414641
networking:
46424642
description: Networking exposes the agent via Service / Ingress.
46434643
properties:
4644+
httpRoute:
4645+
description: |-
4646+
HTTPRoute controls optional Gateway API HTTPRoute creation. The operator
4647+
emits an unstructured gateway.networking.k8s.io/v1 HTTPRoute; the Gateway
4648+
API CRDs must be installed in the cluster for this to take effect.
4649+
properties:
4650+
annotations:
4651+
additionalProperties:
4652+
type: string
4653+
description: Annotations are applied verbatim onto the HTTPRoute.
4654+
type: object
4655+
enabled:
4656+
default: false
4657+
description: |-
4658+
Enabled: when true, the operator creates an HTTPRoute for the agent.
4659+
Default false.
4660+
type: boolean
4661+
hostnames:
4662+
description: Hostnames are the hostnames matched by this route.
4663+
items:
4664+
type: string
4665+
type: array
4666+
x-kubernetes-list-type: set
4667+
parentRefs:
4668+
description: |-
4669+
ParentRefs are the Gateways (or other parents) this route attaches to.
4670+
At least one is required for the route to take effect.
4671+
items:
4672+
description: HTTPRouteParentRef references a parent (typically
4673+
a Gateway) the route attaches to.
4674+
properties:
4675+
name:
4676+
description: Name of the parent resource (e.g. the Gateway
4677+
name).
4678+
minLength: 1
4679+
type: string
4680+
namespace:
4681+
description: Namespace of the parent. Defaults to the
4682+
HermesInstance namespace when empty.
4683+
type: string
4684+
sectionName:
4685+
description: SectionName is the name of a section within
4686+
the parent (e.g. a Gateway listener).
4687+
type: string
4688+
required:
4689+
- name
4690+
type: object
4691+
type: array
4692+
path:
4693+
default: /
4694+
description: Path is the path prefix routed to the agent Service.
4695+
Default "/".
4696+
type: string
4697+
servicePortName:
4698+
default: gateway
4699+
description: |-
4700+
ServicePortName: name of the Service port the route should target.
4701+
Default "gateway".
4702+
type: string
4703+
type: object
46444704
ingress:
46454705
description: Ingress controls optional Ingress creation.
46464706
properties:

config/crd/bases/hermes.agent_hermesinstances.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,6 +4641,66 @@ spec:
46414641
networking:
46424642
description: Networking exposes the agent via Service / Ingress.
46434643
properties:
4644+
httpRoute:
4645+
description: |-
4646+
HTTPRoute controls optional Gateway API HTTPRoute creation. The operator
4647+
emits an unstructured gateway.networking.k8s.io/v1 HTTPRoute; the Gateway
4648+
API CRDs must be installed in the cluster for this to take effect.
4649+
properties:
4650+
annotations:
4651+
additionalProperties:
4652+
type: string
4653+
description: Annotations are applied verbatim onto the HTTPRoute.
4654+
type: object
4655+
enabled:
4656+
default: false
4657+
description: |-
4658+
Enabled: when true, the operator creates an HTTPRoute for the agent.
4659+
Default false.
4660+
type: boolean
4661+
hostnames:
4662+
description: Hostnames are the hostnames matched by this route.
4663+
items:
4664+
type: string
4665+
type: array
4666+
x-kubernetes-list-type: set
4667+
parentRefs:
4668+
description: |-
4669+
ParentRefs are the Gateways (or other parents) this route attaches to.
4670+
At least one is required for the route to take effect.
4671+
items:
4672+
description: HTTPRouteParentRef references a parent (typically
4673+
a Gateway) the route attaches to.
4674+
properties:
4675+
name:
4676+
description: Name of the parent resource (e.g. the Gateway
4677+
name).
4678+
minLength: 1
4679+
type: string
4680+
namespace:
4681+
description: Namespace of the parent. Defaults to the
4682+
HermesInstance namespace when empty.
4683+
type: string
4684+
sectionName:
4685+
description: SectionName is the name of a section within
4686+
the parent (e.g. a Gateway listener).
4687+
type: string
4688+
required:
4689+
- name
4690+
type: object
4691+
type: array
4692+
path:
4693+
default: /
4694+
description: Path is the path prefix routed to the agent Service.
4695+
Default "/".
4696+
type: string
4697+
servicePortName:
4698+
default: gateway
4699+
description: |-
4700+
ServicePortName: name of the Service port the route should target.
4701+
Default "gateway".
4702+
type: string
4703+
type: object
46444704
ingress:
46454705
description: Ingress controls optional Ingress creation.
46464706
properties:

docs/api-reference-generated.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,47 @@ _Appears in:_
281281
| `behavior` _[HorizontalPodAutoscalerBehavior](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#horizontalpodautoscalerbehavior-v2-autoscaling)_ | Behavior is forwarded onto HPA's autoscaling/v2 behavior field.<br />Plan 6 conformance suite asserts the field is exposed; v1 forwards it raw. | | Optional: \{\} <br /> |
282282

283283

284+
#### HTTPRouteParentRef
285+
286+
287+
288+
HTTPRouteParentRef references a parent (typically a Gateway) the route attaches to.
289+
290+
291+
292+
_Appears in:_
293+
- [HTTPRouteSpec](#httproutespec)
294+
295+
| Field | Description | Default | Validation |
296+
| --- | --- | --- | --- |
297+
| `name` _string_ | Name of the parent resource (e.g. the Gateway name). | | MinLength: 1 <br /> |
298+
| `namespace` _string_ | Namespace of the parent. Defaults to the HermesInstance namespace when empty. | | Optional: \{\} <br /> |
299+
| `sectionName` _string_ | SectionName is the name of a section within the parent (e.g. a Gateway listener). | | Optional: \{\} <br /> |
300+
301+
302+
#### HTTPRouteSpec
303+
304+
305+
306+
HTTPRouteSpec controls optional Gateway API HTTPRoute creation. It mirrors the
307+
IngressSpec shape for consistency: a single prefix rule routing to the agent
308+
Service. The route is only created when Enabled is true.
309+
310+
311+
312+
_Appears in:_
313+
- [NetworkingSpec](#networkingspec)
314+
315+
| Field | Description | Default | Validation |
316+
| --- | --- | --- | --- |
317+
| `enabled` _boolean_ | Enabled: when true, the operator creates an HTTPRoute for the agent.<br />Default false. | false | Optional: \{\} <br /> |
318+
| `parentRefs` _[HTTPRouteParentRef](#httprouteparentref) array_ | ParentRefs are the Gateways (or other parents) this route attaches to.<br />At least one is required for the route to take effect. | | Optional: \{\} <br /> |
319+
| `hostnames` _string array_ | Hostnames are the hostnames matched by this route. | | Optional: \{\} <br /> |
320+
| `path` _string_ | Path is the path prefix routed to the agent Service. Default "/". | / | Optional: \{\} <br /> |
321+
| `servicePortName` _string_ | ServicePortName: name of the Service port the route should target.<br />Default "gateway". | gateway | Optional: \{\} <br /> |
322+
| `annotations` _object (keys:string, values:string)_ | Annotations are applied verbatim onto the HTTPRoute. | | Optional: \{\} <br /> |
323+
324+
284325
#### HermesClusterDefaults
285326

286327

@@ -830,6 +871,7 @@ _Appears in:_
830871
| --- | --- | --- | --- |
831872
| `service` _[ServiceSpec](#servicespec)_ | Service controls the Service kind and ports. | | Optional: \{\} <br /> |
832873
| `ingress` _[IngressSpec](#ingressspec)_ | Ingress controls optional Ingress creation. | | Optional: \{\} <br /> |
874+
| `httpRoute` _[HTTPRouteSpec](#httproutespec)_ | HTTPRoute controls optional Gateway API HTTPRoute creation. The operator<br />emits an unstructured gateway.networking.k8s.io/v1 HTTPRoute; the Gateway<br />API CRDs must be installed in the cluster for this to take effect. | | Optional: \{\} <br /> |
833875

834876

835877
#### ObservabilityDefaults

0 commit comments

Comments
 (0)