Create an HTTPRoute with Gateway API
If you install Longhorn on a Kubernetes cluster with kubectl or Helm, you can use Gateway API HTTPRoute as a modern alternative to Ingress for exposing the Longhorn UI to external traffic.
Gateway API is the successor to Ingress, offering more expressive routing capabilities and a standardized approach across different implementations.
Gateway API CRDs installed in your cluster:
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
A Gateway controller running in your cluster (e.g., Istio, Envoy Gateway, Cilium, NGINX Gateway Fabric, Traefik, etc.)
At least one Gateway resource deployed and configured
The following Helm values control HTTPRoute generation:
| Key | Type | Default | Description |
|---|---|---|---|
httproute.enabled | bool | false | Enable HTTPRoute generation for Longhorn UI |
httproute.parentRefs | list | [] | Gateway references specifying which Gateway(s) should handle this route |
httproute.hostnames | list | [] | List of hostnames for the HTTPRoute |
httproute.path | string | "/" | Path for accessing Longhorn UI |
httproute.pathType | string | "PathPrefix" | Path match type: Exact, PathPrefix, or RegularExpression |
httproute.annotations | object | {} | Annotations for the HTTPRoute resource |
Install Longhorn with HTTPRoute enabled:
helm install longhorn longhorn/longhorn \
--namespace longhorn-system \
--create-namespace \
--set "httproute.enabled=true" \
--set "httproute.parentRefs[0].name=my-gateway" \
--set "httproute.parentRefs[0].namespace=default" \
--set "httproute.hostnames[0]=longhorn.example.com"
For more complex setups, create a values file:
httproute:
enabled: true
parentRefs:
- name: primary-gateway
namespace: gateway-system
- name: secondary-gateway
namespace: gateway-system
sectionName: https # Target specific listener
hostnames:
- longhorn.example.com
- longhorn.example.org
path: /longhorn
pathType: PathPrefix
annotations:
custom-annotation: "value"
Install with the values file:
helm install longhorn longhorn/longhorn \
--namespace longhorn-system \
--create-namespace \
--values values.yaml
Verify the HTTPRoute was created:
kubectl get httproute -n longhorn-system
Check HTTPRoute details:
kubectl describe httproute longhorn-httproute -n longhorn-system
Verify the route is accepted by the Gateway:
kubectl get httproute longhorn-httproute -n longhorn-system -o jsonpath='{.status.parents[*].conditions}'
The output should show Accepted: True and ResolvedRefs: True.
Access the Longhorn UI through your Gateway’s external IP or hostname.
© 2019-2026 Longhorn a Series of LF Projects, LLC. Documentation Distributed under CC-BY-4.0.
For website terms of use, trademark policy and other project policies please see lfprojects.org/policies.