Description
Our team encountered an issue with SNR v0.9.0 in scenarios involving A Node without API-Server Access and An Isolated Node.
INFO api-check Error count exceeds threshold, trying to ask other nodes if I'm healthy
INFO api-check Peers list is empty and / or couldn't be retrieved from server, nothing we can do, so consider the node being healthy
INFO api-check peers did not confirm that we are unhealthy, ignoring error
SNR cannot query other nodes because the peer list is empty.
Analysis of the code reveals that SNR uses the node-role.kubernetes.io/worker label as a selector when creating the peer list.
Remediation functions as expected after setting this label.
Documenting this prerequisite would be beneficial.
Note: While the code responsible for the above log output has been modified in the latest version (Add minPeersForRemediation configuration value. · medik8s/self-node-remediation@194acec · GitHub), the underlying issue is likely still present.
Related files:
https://github.com/medik8s/self-node-remediation/blob/c960b00b7671d2b9f67134d18a73c08bde6be30c/pkg/apicheck/check.go#L132C1-L156C3
|
commonlabels "github.com/medik8s/common/pkg/labels" |
https://github.com/medik8s/self-node-remediation/blob/c960b00b7671d2b9f67134d18a73c08bde6be30c/pkg/peers/peers.go#L181C1-L182C37
|
p.workerPeerSelector = createSelector(hostname, commonlabels.WorkerRole) |
|
updateWorkerPeersError := p.updateWorkerPeers(ctx) |
https://github.com/medik8s/self-node-remediation/blob/c960b00b7671d2b9f67134d18a73c08bde6be30c/pkg/peers/peers.go#L104C1-L108C2
https://github.com/medik8s/common/blob/cd032bd2a08da3b2b8dded4fe066037ee5f1a94f/pkg/labels/labels.go#L5
Description
Our team encountered an issue with SNR v0.9.0 in scenarios involving A Node without API-Server Access and An Isolated Node.
SNR cannot query other nodes because the peer list is empty.
Analysis of the code reveals that SNR uses the
node-role.kubernetes.io/workerlabel as a selector when creating the peer list.Remediation functions as expected after setting this label.
Documenting this prerequisite would be beneficial.
Note: While the code responsible for the above log output has been modified in the latest version (Add minPeersForRemediation configuration value. · medik8s/self-node-remediation@194acec · GitHub), the underlying issue is likely still present.
Related files:
https://github.com/medik8s/self-node-remediation/blob/c960b00b7671d2b9f67134d18a73c08bde6be30c/pkg/apicheck/check.go#L132C1-L156C3
self-node-remediation/pkg/peers/peers.go
Line 11 in c960b00
https://github.com/medik8s/self-node-remediation/blob/c960b00b7671d2b9f67134d18a73c08bde6be30c/pkg/peers/peers.go#L181C1-L182C37
self-node-remediation/pkg/peers/peers.go
Line 80 in c960b00
self-node-remediation/pkg/peers/peers.go
Line 86 in c960b00
https://github.com/medik8s/self-node-remediation/blob/c960b00b7671d2b9f67134d18a73c08bde6be30c/pkg/peers/peers.go#L104C1-L108C2
https://github.com/medik8s/common/blob/cd032bd2a08da3b2b8dded4fe066037ee5f1a94f/pkg/labels/labels.go#L5