Comments (5)
Hi @vinu this feature is planned for the current sprint so it will be available at the end of the next 3 weeks.
from strimzi-kafka-operator.
I'm not sure we should really use this by default. Some of my thoughts why ...
Kubernetes will try to schedule the pods of stateful set on separate nodes where possible on its own. So for the basic situations anti-affinity is not needed. The situation when it might not work perfectly is for example:
- you have 3 node Kubernetes cluster
- Kafka is deployed with 3 pods - one pod is scheduled per Kubernetes node
- One of the nodes crashes => Kubernetes reschedules the pod from the crashed node to one of the two other nodes
- The crashed node rejoined the cluster, but Kubernetes will not pro-actively kill one of the pods to move it to the newly joined node. So although we have 3 nodes again, we are running only 2 nodes => problem.
The pod affinity would cause us some complications:
- It will never run a cluster on minikube / minishift / oc cluster up
- We will need to carefully select the anti affinity selector so that it binds the affinity only against Kafka pods from the same Kafka cluster (e.g. if you for whatever reason have multiple Kafka installations)
With regards to the replication, at the end this is not about not running two Kafka nodes on the same host but about not running two Kafka hosts with different rack IDs on the same host. So what we should do is add support for broker.rack
in the Kafka images and add support for host selectors based on the "zone" where the host is running. That will ensure that there might be several Kafka instances running on the same host but always only with the same rack ID and such instances will not share any replicas. And when we have that implemented the only problem which sharing the physical machine for multiple Kafka pods can cause is that they will steal each others disk cache.
The practical complication with podAntiAffinity is that we will need to configure it somehow - we will at least need a set of files without it for testing on single node installations such as minikube / minishift and set of files with anti affinity for running on real clusters. That sounds like something would should be done after #31. I guess that sooner or later we will anyway get to the state when deploying the cluster will be done by some controller - there it would be even easier because you would just tell the controller that it should deploy "with anti-affinity" and it would generate the code for you.
from strimzi-kafka-operator.
- It will never run a cluster on minikube / minishift / oc cluster up
Is that true of preferredDuringSchedulingIgnoredDuringExecution
, wouldn't it just ignore the affinity with that setting?
So what we should do is add support for broker.rack in the Kafka images
Can you open a separate issue for that, @scholzj?
I guess that sooner or later we will anyway get to the state when deploying the cluster will be done by some controller - there it would be even easier because you would just tell the controller that it should deploy "with anti-affinity" and it would generate the code for you.
I'm happy to defer this issue until we have such a controller.
from strimzi-kafka-operator.
You are right, preferredDuringSchedulingIgnoredDuringExecution
should schedule all on Minikube and such (see, I don't know that much about Kubernetes and openShift ;-)). It is also interesting that the Kubernetes docu seems to talk about this even in connection to StatufulSets. I haven't seen any stateful set which would not follow the preferredDuringSchedulingIgnoredDuringExecution
rule automatically. But maybe it is not guaranteed. So maybe we should add it to be sure.
I raised #36 for the rack IDs.
from strimzi-kafka-operator.
hey anything on this yet? -
what is the best way to have podaffinity and antiaffnity with strimzi
thanks
from strimzi-kafka-operator.
Related Issues (20)
- [Bug]: strimzi-cluster-operator keeps restarting with issue: WARN BlockedThreadChecker: - Thread Thread[vert.x-eventloop-thread-1,5,main] has been blocked for
- [Bug]: java.net.UnknownHostException: my-cluster-zookeeper-0.my-cluster-zookeeper-nodes.default.svc
- [Bug]: StrimziPodSet ignores strimzi.io/pause-reconciliation annotation HOT 10
- Performance Scaling Issues with KRaft-Based Kafka Clusters HOT 3
- Strimizi kafka operator, vulnerabilities for v 3.6.0
- [Enhancement]: Support additionalVolumes HOT 5
- [CRD-v1] Make the .spec section in all resources required HOT 1
- [CRD-v1] Try to enforce the Connect topic names or make better defaults HOT 1
- [Bug]: podTemplate securityContext doesn't honor sysctl values HOT 12
- [Bug]: Strimzi operator unable to spin up kafka cluster on gke
- [Enhancement]: Deploy different versions of Strimzi operators in a single k8s cluster, allowing the cluster to deploy different versions of Kafka clusters
- [Bug]: KafkaRebalance resource reconciliation gets stuck if CC pod is restarted during rebalance HOT 9
- Kafka Users are created with ACL entries and during performing operations allowed by ACL we see Denied Operation HOT 1
- [Enhancement]: Ensure Helm chart is published after image published
- [Bug]: Unable to create kafka cluster with security.protocol=SASL_SSL and security.mechanis=PLAIN HOT 2
- [Bug]: Configure kafka connect connection to an existing kafka cluster
- [Bug]: Adding a serviceAccount annotation in KafkaConnect spec makes Cluster Operator Stuck on Reconciliation of Strimzipodset
- [Bug]: KafkaRebalance not respecting replicationThrottle HOT 6
- Add Cruise Control timer metrics to the Topic Operator
- [Bug]: The StrimziPodSetController is not checking controller flag of the old owner before adding new one
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strimzi-kafka-operator.