Kibana expose through K8s Gateway API

I have a python app running and I already managed to expose it through Gateway API and access it through "http:///pythonapp".Next I deployed a Elasticsearch and Kibana instance so I can gain experience in monitoring and in the Elastic Stack, I deployed it using the ECK operator which made it very simple.

The problem is the expose part, while I tested the Gateway and HTTPRoutes configs with a simple html page and my python app and it worked, when I do the same for Kibana instance I keep getting a '503 Service Temporarily Unavailable' error. I checked the status of the route, gateway and Kibana pod and it was all green, I even port-forwarded the Kibana pod and accessed it locally to make sure there wasn't a problem with Kibana.For context I am using NGINX Gateway Fabric for controller of the GW API and got this running on a GCP VM instance with k3s.

Bellow is the code of Kibana deployment and HTTPRoute:

apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
  namespace: elastic-system
spec:
  version: 9.2.2
  count: 1
  elasticsearchRef:
    name: elastic-monitoring
  http:
    tls:
      selfSignedCertificate:
        disabled: true

  podTemplate:
    spec:
      containers:
        - name: kibana
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: kibana-route
  namespace: elastic-system
spec:
  parentRefs:
    - name: main-gw
      namespace: gateway
      sectionName: http
  rules:
    - matches:
      - path:
          type: PathPrefix
          value: /monitoring
      filters:
        - type: URLRewrite
          urlRewrite:
            path:
              type: ReplacePrefixMatch
              replacePrefixMatch: /
      backendRefs:
        - name: kibana-kb-http
          namespace: elastic-system
          port: 5601

I´ve also tried to remove the filters section from the HTTPRoute and using basePath in Kibana. Got the same error.I suspect it has something to do with the prefix.

Any help / suggestions to solve this issue?

Hey @livresco , I’m encountering exactly the same issue. Have you been able to find a solution to this? I’m running on clustered virtual machines. My HTTPRoute:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: kibana
  namespace: elastic-stack
spec:
  hostnames:
  - kibana.k8svm
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: main
    namespace: nginx-gateway
    sectionName: kibana
  rules:
  - backendRefs:
    - group: ""
      kind: Service
      name: es-kb-quickstart-eck-kibana-kb-http
      port: 5601
      weight: 1
    matches:
    - path:
        type: PathPrefix
        value: /

It’s working as expected when connecting through the service directly. For some reason Kibana is the only service which I have this issue with.