konpyutaika / 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://konpyutaika.github.io/nifikop/
Apache License 2.0
126 stars 44 forks source link

When 2 replica set for nifi kop only one nifikop pod serving request(i.e. no load balancer working). #235

Closed narayanbhawar10 closed 1 year ago

narayanbhawar10 commented 1 year ago

What steps will reproduce the bug?

Increase nifikop replica to reproduce issue.

What is the expected behavior?

Both replica should work in parallel

What do you see instead?

Only one replica working

Possible solution

No response

NiFiKop version

v1.0.0

Golang version

latest

Kubernetes version

latest

NiFi version

No response

Additional context

No response

mh013370 commented 1 year ago

Are you saying that if you increase a nifikop deployment to 2 replicas, only one actually does any work?

If so, this is by design. This works through leader election, ensuring there aren't concurrency issues processing individual CRDs (e.g. NifiCluster, NifiDataflow, etc.) in Kubernetes. Given a nifikop deployment with 2 replicas and if/when one nifikop crashes, the other will immediately take over responsibility for all work because it will become the leader.

This is how any workload in Kubernetes behaves which needs to avoid multiple pods processing a single shared resource 🙂

narayanbhawar10 commented 1 year ago

@mh013370 Thanks for making me understand and I understood. I really appreciate.