You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
controller won't run on k8s > 1.20 without fsGroup #890
I identified an issue while upgrading our (outdated) 1.17 cluster to 1.21.
With the TokenRequest and TokenRequestProjection featuregates graduated to GA in 1.20 the SerivceAccount token is now mounted via the projected volume API.
Since metallb runs as nobody user and the projected token is only readable by root(600) or root and fsGroup if set(640) we need to set the fsGroup in the helm chart, or at least, make securityContext configurable via values.yaml.
I'll happily provide a PR for the chart, I'm just curious if I'm doing something wrong and there's another way to run metallb on k8s > 1.20 or if just nobody run it on 1.20+ yet (what I couldn't imagine tbh).
@champtar theres no need to run the controller as root. As discussed in kubernetes/kubernetes#82573 and fixed in kubernetes/kubernetes#89193 you can make the token readable by a specific group by setting fsGroup. Theres no way to make the projected token readable by everyone as far as I know so the fsGroup is the only viable solution.
Or make it configurable but the new default need to fix the issue and if it breaks old use cases we will rethink, the idea is to have everything working out of the box
Good point @champtar, I made securityContext configurable via values and set fsGroup as default. So it clould be overwritten if necessary, but default should work out of the box.
Activity
add securityContext to helm chart values
[-]controller won't run on k8s > 1.20 without gsGroup[/-][+]controller won't run on k8s > 1.20 without fsGroup[/+]add securityContext to helm chart values
add securityContext to helm chart values
champtar commentedon Jun 15, 2021
Maybe the projected token should be configured to be readable by everyone instead of running the controller as root again
TheKangaroo commentedon Jun 16, 2021
@champtar theres no need to run the controller as root. As discussed in kubernetes/kubernetes#82573 and fixed in kubernetes/kubernetes#89193 you can make the token readable by a specific group by setting fsGroup. Theres no way to make the projected token readable by everyone as far as I know so the fsGroup is the only viable solution.
champtar commentedon Jun 16, 2021
why not just add fsGroup and fix it for everyone instead of making it configurable ?
TheKangaroo commentedon Jun 16, 2021
Sure I can change the PR. I wasn't 100% sure if it would brake things for some use cases, so I wanted to make it optional. I'll adjust my PR.
set fsGroup for controller
champtar commentedon Jun 16, 2021
Or make it configurable but the new default need to fix the issue and if it breaks old use cases we will rethink, the idea is to have everything working out of the box
set fsGroup for controller
TheKangaroo commentedon Jun 17, 2021
Good point @champtar, I made securityContext configurable via values and set fsGroup as default. So it clould be overwritten if necessary, but default should work out of the box.
set fsGroup for controller
set fsGroup for controller
set fsGroup for controller
release-notes: Added fsGroup to controller deployment
release-notes: Added fsGroup to controller deployment
set fsGroup for controller
release-notes: Added fsGroup to controller deployment
set fsGroup for controller
release-notes: Added fsGroup to controller deployment
set fsGroup for controller
release-notes: Added fsGroup to controller deployment