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

What RBAC permissions for live apply? Correct values for apiGroups and resources #4095

Open
WTPascoe opened this issue Nov 23, 2023 · 1 comment
Labels
question Further information is requested

Comments

@WTPascoe
Copy link

I am trying to give a user permissions to do kpt live apply

When doing this, an error is returned

Installing inventory ResourceGroup CRD.
error: Type ResourceGroup CRD needs update. Please make sure you have the permission to update CRD then run kpt live install-resource-group.
error installing ResourceGroup crd

If I add a far too broad set of rules to their role, this then succeeds. I'd like to understand what permissions are needed to be able to complete the live apply

- apiGroups: ["*"]
    resources: ["*"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

The file that live init has generated and appears to be triggering this error is as follows:

resourcegroup.yaml
apiVersion: kpt.dev/v1alpha1
kind: ResourceGroup
metadata:
  name: inventory-27342774
  namespace:  mynamespace
  labels:
    cli-utils.sigs.k8s.io/inventory-id: somenumbershere
@WTPascoe WTPascoe added the question Further information is requested label Nov 23, 2023
@github-project-automation github-project-automation bot moved this to Backlog in kpt Nov 23, 2023
@johnbelamaric
Copy link
Contributor

johnbelamaric commented Nov 27, 2023

If the ResourceGroup CRD is not installed, it tries to install it. In that case it would need privileges to add CRDs. My recommendation is that an administrator add the ResourceGroup CRD (for example, with kpt live install-resource-group). After that, the kpt tool itself only needs read on CRDs; since it will find the CRD already installed it will not try to install it again. This usually can be given to ordinary users.

Of course, the user will also need permissions to add the resources in the namespaces that are being applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants