Commit 45a6abb
authored
kill-host-pods.py: filter pods by node (#4819)
Starting with k8s 1.32, AuthorizeNodeWithSelectors is enabled by
default:
https://kubernetes.io/docs/reference/access-authn-authz/node/
If the rbac microk8s addon is enabled, the kube-apiserver will
run with "--authorization-mode=RBAC,Node". This means that
kublets (system:node:$node) will no longer be allowed to access
pods that reside on other nodes.
For this reason, the "kill-host-pods.py" script is now getting
access denied errors:
Error from server (Forbidden): pods is forbidden:
User "system:node:myhostname" cannot list resource "pods" in API group ""
at the cluster scope: can only list/watch pods with spec.nodeName field selector
As suggested by the error message, we'll solve it by filtering
pods by the node name.
Fixes: #48021 parent 47ade06 commit 45a6abb
1 file changed
Lines changed: 3 additions & 1 deletion
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
0 commit comments