0

I am trying to configure kong ingress controller for apache nifi.

About nifi:

Apache nifi instance is running on minikube, and it exposes a rest api that can be accessed with URLs:

http://ip:port/nifi-api/....

calls t /nifi-api work and results are returned as expected.

Service name for nifi instance in its yaml is 'nifi'.

For kong:

Installed kong on minikube, following this. I can see kong resources created.

enter image description here

For creating ingress to put nifi api behind kong, following this.

My ingress yaml:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nifi-api-routing
  annotations:
    konghq.com/strip-path: 'true'
spec:
  ingressClassName: kong
  rules:
  - host: kong.example
    http:
      paths:
      - path: /nifi-api
        pathType: ImplementationSpecific
        backend:
          service:
            name: nifi
            port:
              number: 30026

backend.service.name and backend.service.port are from service yaml for nifi. path is '/nifi-api' as nifi exposes its endpoints at it. host name 'kong.example' is same as one used in link.

My question is what all this means to client. If I call:

http://kong.example/nifi-api/...

It doesn't work. Browser cant reach the site.

curl -i $PROXY_IP still says 'no route matched with those values'.

Mandroid
  • 6,200
  • 12
  • 64
  • 134

1 Answers1

1

Your issue should not be related to Kubernetes/Minikube but to the missing route to connect your host (kong.example).

To fix it, first, delete the ingress:

kubectl delete ingress nifi-api-routing

enable ingress on minikube:

minikube addons enable ingress

get the minikube ip:

minikube ip
> 192.168.x.x

and use it to add a new line into the file /etc/hosts to create the route:

192.168.x.x kong.example

finally, re-create your ingress with:

kubectl apply -f ingressyaml

If you search the ingress with kubectl get ingress, you should see something like:

NAME             CLASS   HOSTS          ADDRESS       PORTS   AGE
nifi-api-routing nginx   kong.example   192.168.x.x   80      5m

Now, you can try to browse host with curl http://kong.example/echo.

Alez
  • 1,913
  • 3
  • 18
  • 22
  • Thanks. Your inputs helped me made progress. But I still see 3 issues. First, ingress has no ADDRESS assigned. Second, all service calls are fetching same response, some metadata. Third, I still have to make call like 'kong.example:port/nifi-api/....', port must not be needed, isn't? – Mandroid Jun 29 '23 at 08:45
  • I edited my answer because i forgot to mention to enable ingress on minikube. Please revise it to get the IP address. Yes, you don't need to specify the port number with curl. – Alez Jun 29 '23 at 09:02
  • I think addons command has to be run before executing yaml for kong-ingress-controller, because KIC depends on nginx ingress. But I am really not sure. Kong documentation is pretty bad, I would say. – Mandroid Jun 29 '23 at 12:29