Skip to content

Commit

Permalink
Update ClusterRollingUpgrading state to always be in Progressing stat…
Browse files Browse the repository at this point in the history
…e regardless of broker status

Signed-off-by: Ha Van <musubi7726@gmail.com>
  • Loading branch information
musubi7726 committed Apr 26, 2024
1 parent 96e796e commit c3a63a0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 7 deletions.
@@ -1,5 +1,10 @@
local health_status = {}
if obj.status ~= nil then
if obj.status.state == "ClusterRollingUpgrading" then
health_status.message = "Kafka Cluster is Rolling Upgrading."
health_status.status = "Progressing"
return health_status
end
if obj.status.brokersState ~= nil then
local numberBrokers = 0
local healthyBrokers = 0
Expand All @@ -23,11 +28,6 @@ if obj.status ~= nil then
health_status.status = "Progressing"
return health_status
end
if obj.status.state == "ClusterRollingUpgrading" then
health_status.message = "Kafka Cluster is Rolling Upgrading."
health_status.status = "Progressing"
return health_status
end
end
else
health_status.message = "Broker Config is out of Sync or CruiseControlState is not Ready"
Expand All @@ -38,4 +38,4 @@ if obj.status ~= nil then
end
health_status.status = "Progressing"
health_status.message = "Waiting for KafkaCluster"
return health_status
return health_status
Expand Up @@ -7,11 +7,15 @@ tests:
status: Progressing
message: "Waiting for KafkaCluster"
inputPath: testdata/updating.yaml
- healthStatus:
status: Progressing
message: "Kafka Cluster is Rolling Upgrading."
inputPath: testdata/rollingUpgrade.yaml
- healthStatus:
status: Degraded
message: "Broker Config is out of Sync or CruiseControlState is not Ready"
inputPath: testdata/degraded.yaml
- healthStatus:
status: Healthy
message: "Kafka Brokers, CruiseControl and cluster are in Healthy State."
inputPath: testdata/healthy.yaml
inputPath: testdata/healthy.yaml
@@ -0,0 +1,48 @@
apiVersion: kafka.banzaicloud.io/v1beta1
kind: KafkaCluster
metadata:
finalizers:
- finalizer.kafkaclusters.kafka.banzaicloud.io
- topics.kafkaclusters.kafka.banzaicloud.io
- users.kafkaclusters.kafka.banzaicloud.io
generation: 4
labels:
argocd.argoproj.io/instance: kafka-cluster
controller-tools.k8s.io: "1.0"
name: kafkacluster
namespace: kafka
name: kafkacluster
namespace: kafka
resourceVersion: "31935335"
selfLink: /apis/kafka.banzaicloud.io/v1beta1/namespaces/2269-kafka/kafkaclusters/kafkacluster
uid: c6affef0-651d-44c7-8bff-638961517c8d
spec: {}
status:
alertCount: 0
brokersState:
"0":
configurationState: ConfigInSync
gracefulActionState:
cruiseControlState: GracefulUpscaleSucceeded
errorMessage: CruiseControlTopicReady
rackAwarenessState: |
broker.rack=us-east-1,us-east-1c
"1":
configurationState: ConfigInSync
gracefulActionState:
cruiseControlState: GracefulUpscaleSucceeded
errorMessage: CruiseControlTopicReady
rackAwarenessState: |
broker.rack=us-east-1,us-east-1b
"2":
configurationState: ConfigOutOfSync
gracefulActionState:
cruiseControlState: GracefulUpscaleSucceeded
errorMessage: CruiseControlTopicReady
rackAwarenessState: |
broker.rack=us-east-1,us-east-1a
cruiseControlTopicStatus: CruiseControlTopicReady
rollingUpgradeStatus:
errorCount: 0
lastSuccess: ""
state: ClusterRollingUpgrading

0 comments on commit c3a63a0

Please sign in to comment.