TIS1401 - HTTPRoute Points to a Non-Existent Kubernetes Gateway
The HTTPRoute is configured to point to a non-existent Kubernetes gateway.
HTTPRoute Points to an Existing GatewayTo avoid routing issues, ensure the parentRefs in HTTPRoute references an existing gateway in the cluster.
Examples
-
HTTPRouteReferencing a Non-Existent GatewayapiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
metadata:
name: my-http-route
namespace: example-namespace
spec:
parentRefs:
- name: non-existent-gateway
namespace: example-namespace
rules:
- matches:
- path:
type: Prefix
value: "/myapp"
backendRefs:
- name: my-app-service
port: 80Explanation: The
HTTPRouteis referencing a gateway namednon-existent-gatewaythat does not exist in the namespace. This prevents theHTTPRoutefrom being properly applied, leading to routing issues.
Recommendation
Update the parentRefs field to target an existing gateway.
-
Update the
parentRefsto Point to an Existing GatewayUpdate the
HTTPRouteto reference a valid gateway.apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
metadata:
name: my-http-route
namespace: example-namespace
spec:
parentRefs:
- name: existing-gateway
namespace: example-namespace
rules:
- matches:
- path:
type: Prefix
value: "/myapp"
backendRefs:
- name: my-app-service
port: 80Explanation: By updating the
parentRefsto point to an existing gateway (existing-gateway), theHTTPRouteis properly applied and traffic can be routed correctly through the gateway.