Orange-OpenSource / nifikop

The NiFiKop NiFi Kubernetes operator makes it easy to run Apache NiFi on Kubernetes. Apache NiFI is a free, open-source solution that support powerful and scalable directed graphs of data routing, transformation, and system mediation logic.
https://orange-opensource.github.io/nifikop/
Apache License 2.0
128 stars 34 forks source link

Accessing Nifi #77

Closed celsomarques closed 3 years ago

celsomarques commented 3 years ago

Type of question

I'm not able to access Nifi from outside of containers.

Question

I'd followed the quick start page but the external IP of LoadBalancer is in Pending state forever. I'm able to see Nifi page when run the following command inside of container: curl http://nifi-headless.nifi.svc.cluster.local:8080

Could you help me to point what I'm doing wrong, please?

NAMESPACE      NAME                                           READY   STATUS    RESTARTS   AGE
cert-manager   pod/cert-manager-cainjector-6d9776489b-svvdf   1/1     Running   0          18m
cert-manager   pod/cert-manager-d7d8fb5c9-skk29               1/1     Running   0          18m
cert-manager   pod/cert-manager-webhook-6d6d6f9-grm8w         1/1     Running   0          18m
default        pod/zookeeper-0                                1/1     Running   0          19m
default        pod/zookeeper-1                                1/1     Running   0          19m
default        pod/zookeeper-2                                1/1     Running   0          19m
kube-system    pod/coredns-74ff55c5b-9fh6d                    1/1     Running   0          117m
kube-system    pod/etcd-minikube                              1/1     Running   0          117m
kube-system    pod/kube-apiserver-minikube                    1/1     Running   0          117m
kube-system    pod/kube-controller-manager-minikube           1/1     Running   0          117m
kube-system    pod/kube-proxy-c6pd7                           1/1     Running   0          117m
kube-system    pod/kube-scheduler-minikube                    1/1     Running   0          117m
kube-system    pod/storage-provisioner                        1/1     Running   1          117m
nifi           pod/nifi-1-nodehf8hv                           1/1     Running   0          14m
nifi           pod/nifikop-55b6f94469-qt4wr                   1/1     Running   0          16m

NAMESPACE      NAME                           TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                       AGE
cert-manager   service/cert-manager           ClusterIP      10.97.146.110    <none>        9402/TCP                      18m
cert-manager   service/cert-manager-webhook   ClusterIP      10.105.32.254    <none>        443/TCP                       18m
default        service/kubernetes             ClusterIP      10.96.0.1        <none>        443/TCP                       117m
default        service/zookeeper              ClusterIP      10.100.136.32    <none>        2181/TCP,2888/TCP,3888/TCP    19m
default        service/zookeeper-headless     ClusterIP      None             <none>        2181/TCP,2888/TCP,3888/TCP    19m
kube-system    service/kube-dns               ClusterIP      10.96.0.10       <none>        53/UDP,53/TCP,9153/TCP        117m
nifi           service/clusterip              ClusterIP      10.108.181.8     <none>        8080/TCP                      14m
nifi           service/loadbalancer           LoadBalancer   10.101.103.135   <pending>     8080:30779/TCP                14m
nifi           service/nifi-headless          ClusterIP      None             <none>        8080/TCP,6007/TCP,10000/TCP   14m
nifi           service/nodepart               NodePort       10.97.250.218    <none>        8080:31958/TCP                14m

Environment

Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:28:09Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:20:00Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
erdrix commented 3 years ago

Your issue here seems to be that your kubernetes doesn't have any LoadBalancer or IP solution available, so your service will get stuck. I don't really know how to configure services with kind, but quickly checking the documentation, it seems there are 2 ways to deal with it :

Keep in mind that these 3 services :

nifi           service/clusterip              ClusterIP      10.108.181.8     <none>        8080/TCP                      14m
nifi           service/loadbalancer           LoadBalancer   10.101.103.135   <pending>     8080:30779/TCP                14m
....
nifi           service/nodepart               NodePort       10.97.250.218    <none>        8080:31958/TCP                14m

are creating based on your spec : https://github.com/Orange-OpenSource/nifikop/blob/master/config/samples/simplenificluster.yaml#L52, so you are not force to use all kind of service (just set the ones you need :) )

At the end if you were successful in setting up the NiFi cluster on Kind, it would be really nice if you could share your configuration (I could add it in the setup documentation !).

celsomarques commented 3 years ago

I'm running on minikube. What you said applies to minikube too? Thank you!

erdrix commented 3 years ago

For minikube it is simplier you just have to follow this : https://kubernetes.io/docs/tutorials/hello-minikube/#create-a-service by running :

minikube service loadbalancer
celsomarques commented 3 years ago

OMG!!! Thank you @erdrix !!!