feat: integration of gateway api - #17
Conversation
|
@jvlxz tu peux documenter les nouvelles permissions necessaire pour les gateway api ? D'autant plus, que yggdrasil crash si pas dispo : informersSynced = append(informersSynced,
gatewayClassInformer.HasSynced, gatewayInformer.HasSynced, httpRouteInformer.HasSynced,
referenceGrantInformer.HasSynced, serviceInformer.HasSynced, namespaceInformer.HasSynced) |
|
ConvertGatewayResources returning an err makes GetIngresses return nil, err — aborting the entire snapshot rebuild, including every healthy Ingress. One bad gateway object could stall reconciliation for everything. |
|
Different source kinds are not treated as conflicting, so both are kept and their upstreams merged; ordering is implicit (sourcePriority sorts Ingress first). Which source's annotations/timeouts win is not explicit. |
|
CertificateRefs[0] only — multi-cert listeners unsupported. Document the limitation. |
|
Could you add the mention of gateway resources in README? Or possibly all at once in #18 with CRD examples? |
4fb7aae to
dcf94fc
Compare
feat: implement gateway upstream resolution precedence
The Ingress->SourceRoute rename accidentally changed RouteSource.Kind from "Ingress" to "SourceRoute", altering the source_kind label on the EnvoyUpstreamInfo gauge and breaking existing dashboards. The value is a pure metric/log passthrough (only "HTTPRoute" is matched in logic), so restoring the literal is behavior-neutral.
feat: YggdrasilPolicy CRD and shared RoutePolicy model
fix: skip gateway informers when Gateway API CRDs absent
fix: TLS precedence on shared hosts + upstream SNI regression
Initial OpenWiki init: quickstart plus architecture, routing-and-policy, kubernetes-integration, envoy-generation, and configuration pages. Adds the OpenWiki reference section to AGENTS.md.
6bf63d7 to
7362f9e
Compare
docs: add OpenWiki documentation wiki
Summary
Integrates Kubernetes Gateway API support into Yggdrasil.
This adds support for discovering and translating
Gateway,HTTPRoute,GatewayClass, andReferenceGrantresources into Envoy configuration, alongside existing Ingress support. It also introduces a source-agnostic route policy model shared by Ingress annotations, HTTPRoute annotations, and the newYggdrasilPolicyCRD.Changes
gatewayClassesare configured, and skip them when the Gateway API CRDs are absent (no crash on clusters without them).HTTPRouteresources into Yggdrasil ingress-like routing config.sectionName, andAllowedRoutesnamespace policies.ReferenceGrant.RoutePolicymodel (pkg/policy): Ingress/HTTPRoute annotations and the newYggdrasilPolicyCRD are parsed into one model; Envoy generation consumesRoutePolicyonly, never raw annotations.YggdrasilPolicyCRD (yggdrasil.uswitch.com/v1alpha1) to attach policy to an HTTPRoute viatargetRef, plus generated clients/informers/listers.source_kind="HTTPRoute", while preserving the existingsource_kind="Ingress"label.Policy sources
Yggdrasil route behavior (timeouts, healthcheck, retry, upstream http version, weight, connection limits, sticky sessions) can come from three sources, all parsed into the shared
RoutePolicy:yggdrasil.uswitch.com/*) — unchanged legacy behavior.yggdrasil.uswitch.com/*) — used as a fallback when noYggdrasilPolicytargets the route.YggdrasilPolicyCRD — preferred for HTTPRoutes. A policy targets a same-namespace HTTPRoute viaspec.targetRef(group: gateway.networking.k8s.io,kind: HTTPRoute). When one exists, the HTTPRoute's own annotations are ignored for policy.Parsing strictness differs by source, on purpose:
YggdrasilPolicy: a malformed spec rejects the whole policy source, so partial application never happens.YggdrasilPolicyobjects target the same HTTPRoute, all are ignored and a diagnostic is emitted.Policy conflict / precedence behavior
Conflicts are detected per host, per source kind, using a deterministic policy
Signature()(weight is excluded — it is upstream weighting, not host policy; empty signatures are skipped).Same source kind on the same host, divergent signatures (Ingress vs Ingress, or HTTPRoute vs HTTPRoute)
"same source kind policy conflict").k8sconversion layer (resolvePolicyConflicts); Envoy translation does not duplicate it.Ingress + HTTPRoute on the same host
Note: for a Gateway API route, policy comes from the
YggdrasilPolicytargeting the HTTPRoute (or, absent that, from the HTTPRoute's own annotations) — not from the Gateway metadata. Ahealthcheck-pathset on theGatewayhas no effect; set it on theYggdrasilPolicy/HTTPRoute instead.