strimzi / strimzi-kafka-operator

Apache Kafka® running on Kubernetes
https://strimzi.io/
Apache License 2.0
4.86k stars 1.3k forks source link

Improve the additional columns for `KafkaRebalance` resource #10654

Closed scholzj closed 1 month ago

scholzj commented 1 month ago

When listing the KafkaRebalance resources, we have quite a lot of different columns especially with the column-per-state. This can make the listing quite long and hard to read, especially with the long names used for the auto-rebalance resources which often force the line to break. The number of columns and the fact that it always lists only True as the value makes it then very confusing as the value and the columns sometimes misalign. The rebalances in the example below are actually READY ... who would have guessed:

NAME                                   CLUSTER   PENDINGPROPOSAL   PROPOSALREADY   REBALANCING   READY   NOTREADY   STOPPED
my-cluster-auto-rebalancing-template
my-cluster-auto-rebalancing-add-brokers   my-cluster
my-cluster-auto-rebalancing-add-brokers   my-cluster   True
my-cluster-auto-rebalancing-add-brokers   my-cluster                     True
my-cluster-auto-rebalancing-add-brokers   my-cluster                                     True
my-cluster-auto-rebalancing-add-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-add-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-add-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-add-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-remove-brokers   my-cluster
my-cluster-auto-rebalancing-remove-brokers   my-cluster                     True
my-cluster-auto-rebalancing-remove-brokers   my-cluster                                     True
my-cluster-auto-rebalancing-remove-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-remove-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-remove-brokers   my-cluster                                                   True
my-cluster-auto-rebalancing-remove-brokers   my-cluster                                                   True

We should consider if we can some how improve the layout and make it easier to read. The simples option might be shorten the column names. E.g.

We could also consider to have a single column with the state. This is not completely simple. But we can do something like:

.status.conditions[*].type

That would work well as long as we have only one condition (which is the typical case, but might not be like that in 100% of situations):

NAME           CLUSTER      STATUS
my-rebalance   my-cluster   Rebalancing

It would be also nice to have a column to clearly list that the KafkaRebalance resource is a template. But that seems to be quite hard. I wonder if it would make sense to change from strimzi.io/rebalnce: template to something like strimzi.io/rebalnce-template: true to make this easier. That might also allow us to more easily exclude these from the watch and avoid misleading log messages about the templates. But not sure how easy would it be to change the annotation in the KafkaRebalanceAssemblyOperator to ignore it.

ppatierno commented 1 month ago

Triaged on 03.10.2024: agree on having just one column STATUS for the KafkaRebalance status and changing the current annotation to define a KafkaRebalance as a template from strimzi.io/rebalance: template to strimzi.io/rebalance-template: true in order to have just one column named template (with true or false value).