feat: stamp Queue shard status with availability zones
Resolves each shard topic's replica broker IDs (internal/kafka.Admin. ReplicaBrokerIDs) to the topology.kubernetes.io/zone labels of the nodes hosting those brokers (ZoneLocator), and writes the result into ShardStatus.AvailabilityZones each reconcile. Uses mgr.GetAPIReader() rather than the cached client for the Pod/Node lookups, since the cached client would otherwise require cluster-wide list/watch RBAC on Pods just to serve occasional point Gets.
This commit is contained in:
@@ -51,6 +51,15 @@ func (f *fakeAdmin) ConsumerLag(_ context.Context, group, topic string) (int64,
|
||||
return f.lag[group+"/"+topic], nil
|
||||
}
|
||||
|
||||
func (f *fakeAdmin) ReplicaBrokerIDs(_ context.Context, topic string) ([]int32, error) {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
if _, ok := f.topics[topic]; !ok {
|
||||
return nil, nil
|
||||
}
|
||||
return []int32{0}, nil
|
||||
}
|
||||
|
||||
func (f *fakeAdmin) setOffsetSum(topic string, v int64) {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user