Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: BanzaiCloud KafkaCluster healthcheck to return Progressing during rolling update #17994

Merged
merged 4 commits into from May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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