AMDEPYC / AMDEPYC/kubernetes-power-manager

Changing the cluster topology doesn't cause PowerConfig to be reconciled again

Aperta
#35 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Go
Stelle
5
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Changes in the cluster topology like listed below doesn't cause PowerConfig to be reconciled again:
1. Adding Nodes to the cluster.
2. Removing Nodes from the cluster.
3. Adding labels to Nodes so that they match the node selector in the PowerConfig.
4. Removing labels from Nodes so that they no longer match the node selector in the PowerConfig.

In turn, cluster-wide state is not reconciled correctly; for example, PowerNode is not immediately created for a newly added Node.

### Steps to reproduce

1. Remove the `feature.node.kubernetes.io/power-node` label from the Node so that it no longer matches the PowerConfig's node selector.

### Expected result

1. Node Agent Pod for the Node is removed.
2. PowerNode, PowerWorkload, and other node-scoped resources managed by Kubernetes Power Manager are immediately deleted.

### Actual result

1. Node Agent Pod for the Node is removed.
2. PowerNode, PowerWorkload, and other node-scoped resources managed by Kubernetes Power Manager are only deleted after restarting the Power Operator or on next scheduled reconciliation.

### Root cause

PowerConfig controller doesn't watch Nodes.

### Proposed solution

Add watch for Nodes to PowerConfig controller in `SetupWithManager()`.

https://github.com/AMDEPYC/kubernetes-power-manager/blob/790697dbbc1c28c5e1866556bef1b2b7232b9bfa/internal/controller/powerconfig_controller.go#L386-L390

Any change to these resources should enqueue reconciliation of the PowerConfig resource (if one exists) using [`EnqueueRequestsFromMapFunc()`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/handler#EnqueueRequestsFromMapFunc).

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.