forked from banzaicloud/koperator
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure Kafka broker pods are maintained in Service rotation until cle…
…an shutdown completes On kafka pod clean termination (e.g. when pod is evicted during an underlying k8s node maintenance, or rescheduling) kubelet sends a SIGTERM to the pod and kafka process initiates the clean shutdown procedure: https://kafka.apache.org/documentation/#basic_ops_restarting During this period and upon `terminationGracePeriodSeconds` the kafka broker will: - flush and sync all the segment logs - migrate any partitions the server is the leader for to other replicas To ensure the broker is still accessible during this period we are setting/extending two new parameters: 1/ Configurable `terminationGracePeriodSeconds ` https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#podspec-v1-core Default 120s, can be overridden for larger Kafka brokers that may take longer to terminate 2/ Set publishNotReadyAddresses=true for Kafka headless service https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#servicespec-v1-core This is set to ensure that a broker entering the Terminating phase is still advertised in the headless DNS services so clients can continue reaching to it until it migrates all the leader partitions and shuts down successfully There is also a drawback for this though, the kafka pod will be advertised in the headless service as soon as the pod is started and not waiting for the readiness probe to be successful. This was considered to be a non-issue as: 1/ the opearator doesn't set yet a readiness probe for kafka pod 2/ even if there is one, the kafka clients will retry if they hit a kafka broker not yet fully ready
- Loading branch information
Showing
6 changed files
with
70 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters