Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RBAC to satellite daemonset #24

Merged
merged 14 commits into from
Feb 11, 2021
Merged

Add RBAC to satellite daemonset #24

merged 14 commits into from
Feb 11, 2021

Conversation

jbanety
Copy link
Contributor

@jbanety jbanety commented Feb 3, 2021

Lokomotive clusters have PodSecurityPolicy (PSP) enabled by default so I need to apply to satellite containers a permissive PSP.

@jbanety jbanety changed the title Add RBAC to satellite deamonset Add RBAC to satellite daemonset Feb 3, 2021
@kvaps
Copy link
Owner

kvaps commented Feb 3, 2021

Thanks, wouldn't it work with the automountServiceAccountToken: false?

@jbanety
Copy link
Contributor Author

jbanety commented Feb 3, 2021

Nop.
We need a service account to assign permissions to access host network, run root containers,...
And to enforce security, Lokomotive has a webhook to disable automounting default service account.
https://kinvolk.io/docs/lokomotive/0.5/concepts/admission-webhook/

@kvaps
Copy link
Owner

kvaps commented Feb 3, 2021

Got it! Could you also contribute PSP policy itself?

Example manifest from old stable repo
https://github.com/helm/charts/blob/2f030a8e9db3e451e8030b12d2658371f5708f7d/stable/elasticsearch/templates/podsecuritypolicy.yaml

@jbanety
Copy link
Contributor Author

jbanety commented Feb 3, 2021

Haha, I have already created static manifests in my Lokomotive component.
I still have to define the permissions to apply.
Containers are running as root.
Can we run them as regular user ?

@kvaps
Copy link
Owner

kvaps commented Feb 5, 2021

Well it's not a problem to run controller and other daemons as unprivileged user. But I'm not sure if it is possible to make satellite daemon running, because it is operating with the LVM, devicemapper, DRBD and ZFS quite hard.
I'm worry that specific permissions are required for it.

@kvaps
Copy link
Owner

kvaps commented Feb 9, 2021

Thanks! I'll review and merge this in a while!🤘

@jbanety
Copy link
Contributor Author

jbanety commented Feb 9, 2021

This is a very permissive policy.
I did not find time to dig into this.

@kvaps
Copy link
Owner

kvaps commented Feb 9, 2021

I think you don't have to. PSP is going to be deprecated in the next Kubernetes release:
kubernetes/kubernetes#97171

@jbanety
Copy link
Contributor Author

jbanety commented Feb 9, 2021

OK. That's enough then.

@jbanety
Copy link
Contributor Author

jbanety commented Feb 9, 2021

Sorry for the mess. This is OK now 🙄

Copy link
Owner

@kvaps kvaps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this configurable, also add to values.yaml

## Specify if a Pod Security Policy for node-exporter must be created
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
##
podSecurityPolicy:
  enabled: false

Copy link
Owner

@kvaps kvaps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot these two

@kvaps kvaps merged commit d9f3dd7 into kvaps:master Feb 11, 2021
@kvaps
Copy link
Owner

kvaps commented Feb 11, 2021

merged, thanks!

@kvaps kvaps mentioned this pull request Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants