Skip to content

Commit

Permalink
Add ConcurrentBrokerRestartsAllowed to RollingUpgradeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltluc committed Jun 26, 2023
1 parent 25c4e97 commit 5ce90ba
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/v1beta1/kafkacluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ type RollingUpgradeConfig struct {
// distinct broker replicas with either offline replicas or out of sync replicas and the number of alerts triggered by
// alerts with 'rollingupgrade'
FailureThreshold int `json:"failureThreshold"`

// ConcurrentBrokerRestartsAllowed controls how many brokers can be restarted in parallel during a rolling upgrade. If
// it is set to a value greater than 1, the operator will restart up to that amount of brokers in parallel, if the
// brokers are within the same rack (as specified by "broker.rack" in broker read-only configs). Since using Kafka broker
// racks spreads out the replicas, we know that restarting multiple brokers in the same rack will not cause more than
// 1/Nth of the replicas of a topic-partition to be unavailable at the same time, where N is the number of racks used.
// This is a safe way to speed up the rolling upgrade. Note that for the rack distribution explained above, Cruise Control
// requires `com.linkedin.kafka.cruisecontrol.analyzer.goals.RackAwareDistributionGoal` to be configured.
// +optional
ConcurrentBrokerRestartsAllowed int `json:"concurrentBrokerRestartsAllowed,omitempty"`
}

// DisruptionBudget defines the configuration for PodDisruptionBudget where the workload is managed by the kafka-operator
Expand Down
15 changes: 15 additions & 0 deletions charts/kafka-operator/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21689,6 +21689,21 @@ spec:
description: RollingUpgradeConfig defines the desired config of the
RollingUpgrade
properties:
concurrentBrokerRestartsAllowed:
description: ConcurrentBrokerRestartsAllowed controls how many
brokers can be restarted in parallel during a rolling upgrade.
If it is set to a value greater than 1, the operator will restart
up to that amount of brokers in parallel, if the brokers are
within the same rack (as specified by "broker.rack" in broker
read-only configs). Since using Kafka broker racks spreads out
the replicas, we know that restarting multiple brokers in the
same rack will not cause more than 1/Nth of the replicas of
a topic-partition to be unavailable at the same time, where
N is the number of racks used. This is a safe way to speed up
the rolling upgrade. Note that for the rack distribution explained
above, Cruise Control requires `com.linkedin.kafka.cruisecontrol.analyzer.goals.RackAwareDistributionGoal`
to be configured.
type: integer
failureThreshold:
description: FailureThreshold controls how many failures the cluster
can tolerate during a rolling upgrade. Once the number of failures
Expand Down
15 changes: 15 additions & 0 deletions config/base/crds/kafka.banzaicloud.io_kafkaclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21526,6 +21526,21 @@ spec:
description: RollingUpgradeConfig defines the desired config of the
RollingUpgrade
properties:
concurrentBrokerRestartsAllowed:
description: ConcurrentBrokerRestartsAllowed controls how many
brokers can be restarted in parallel during a rolling upgrade.
If it is set to a value greater than 1, the operator will restart
up to that amount of brokers in parallel, if the brokers are
within the same rack (as specified by "broker.rack" in broker
read-only configs). Since using Kafka broker racks spreads out
the replicas, we know that restarting multiple brokers in the
same rack will not cause more than 1/Nth of the replicas of
a topic-partition to be unavailable at the same time, where
N is the number of racks used. This is a safe way to speed up
the rolling upgrade. Note that for the rack distribution explained
above, Cruise Control requires `com.linkedin.kafka.cruisecontrol.analyzer.goals.RackAwareDistributionGoal`
to be configured.
type: integer
failureThreshold:
description: FailureThreshold controls how many failures the cluster
can tolerate during a rolling upgrade. Once the number of failures
Expand Down

0 comments on commit 5ce90ba

Please sign in to comment.