Closed surajssd closed 5 years ago
So tl;dr of this whole issue is I want to find out for a particular PSP who all can use it.
Hi @surajssd, thanks for taking the time and reporting this. This is definitely a use-case that rakkess
should support. I would suggest to allow arbitrary verbs for the rakkess resource
subcommand, because basically anything can be put into a clusterrole.
On the other hand I would not want to touch the list of allowed verbs for the main command, because only verbs listed in kubectl api-resources -owide
make sense there. Do you agree?
@surajssd Can you check if the pre-release version works as expected? https://github.com/corneliusweig/rakkess/releases/tag/v0.4.1-pre
For the example above, please remember that the ClusterRole only applies to a single named resource. So this will work:
rakkess resource psp restricted --verbs use
and this will ignore your ClusterRole:
rakkess resource psp --verbs use
@corneliusweig the above commands worked for me with the release you have proided
Expected behavior
I want results for
use
verb.Actual behavior
Right now if I list the resource
podsecuritypolicy
and define verbuse
I get error.Steps To Reproduce
Steps to reproduce the behavior:
Just setup a cluster that has PodSecurityPolicy admission plugin enabled. Also install PSP in your cluster, since they are not automatically installed. If you want an example of a PSP then just do
kubectl apply -f URL
on the files in these two links: https://github.com/kinvolk/terraform-render-bootkube/blob/kinvolk-master/resources/manifests/psp-restricted.yaml and https://github.com/kinvolk/terraform-render-bootkube/blob/kinvolk-master/resources/manifests/psp-privileged.yamlOnce you have cluster with PSP run following command:
-v debug
to show extra logging.Context:
Additional context
The PSPs are made usable by using verb
use
in the Role or ClusterRole and then it is bound to serviceaccounts or users using RoleBinding ro ClusterRoleBinding. Like here is an example from the PSP snippets link I have posted above.Above snippet is from this source https://github.com/kinvolk/terraform-render-bootkube/blob/0913331140747fd464946981c1d43a895d7a630b/resources/manifests/psp-restricted.yaml#L52-L75