Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Conversation

@mlitvin
Copy link
Contributor

@mlitvin mlitvin commented Mar 7, 2020

Add the ability to create pod security policy to allow working in cluster where the default pod security policy is not enough (probably because it doesn't support hostPath volumes).

It always create and uses a service account for ksync, but actually create a PSP only if specifically requested.

See #341

@timfallmk
Copy link
Collaborator

timfallmk commented Mar 7, 2020

This honestly looks great! Were you thinking that ksync init --psp would require use of the --upgrade flag as well? Also, any harm to just adding the PSP to the init by default for green field installs?

  • One suggestion might be add a check to doctor as well, but that's a stretch goal I think.

Thanks for the hard work!

@timfallmk
Copy link
Collaborator

Fixes #341

@moshelitvin-MS
Copy link

Thanks.

  1. The way that it is written it should work with and without the -u flag.

  2. The reasons not to create PSP by default are:
    A. It add some complication and it seems that most environments it is not needed (as evident by the fact that I probably the first one to complain)
    B. Some people may like to more carefully edit the PSPs that they add to their cluster.

Those reasons are not very strong. If you like we can change the default to install PSP.

As for the doctor: as far as I understand the existing doctor checks will identify that something is wrong (the pods are not running) - they won't identify the cause. Identifying the cause will require identifying that the pods cannot be scheduled due to missing PSP - which will probably require looking at the errors events posted on the daemon set. That is indeed a stretch goal and I rather not do it.

Copy link
Collaborator

@grampelberg grampelberg left a comment

Choose a reason for hiding this comment

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

This looks really great to me. The only change I'd make would be to have PSP there always. You're totally right that it isn't required 100% of the time, but for those not using it ... it isn't that big of a deal. It is sane for clusters to be 1.14 or newer, so PSP is pretty much everywhere at this point.

@moshelitvin-MS
Copy link

@grampelberg: Does changing the default (so that by default PSP is installed) OK with you?

This looks really great to me. The only change I'd make would be to have PSP there always. You're totally right that it isn't required 100% of the time, but for those not using it ... it isn't that big of a deal. It is sane for clusters to be 1.14 or newer, so PSP is pretty much everywhere at this point.

@grampelberg
Copy link
Collaborator

@moshelitvin-MS yup!

Copy link
Collaborator

@grampelberg grampelberg left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you!!

@timfallmk
Copy link
Collaborator

Looks good to me too. I totally agree on skipping doctor here.

@grampelberg
Copy link
Collaborator

@mlitvin only thing left is having your commits signed. Once we've got that, this can get merged! See signing commits for more info.

@timfallmk timfallmk merged commit 7992c5f into ksync:master Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants