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

deploy: add RBAC definitions#69

Merged
k8s-ci-robot merged 1 commit into
kubernetes-retired:masterfrom
pohly:rbac
Nov 2, 2018
Merged

deploy: add RBAC definitions#69
k8s-ci-robot merged 1 commit into
kubernetes-retired:masterfrom
pohly:rbac

Conversation

@pohly
Copy link
Copy Markdown
Contributor

@pohly pohly commented Oct 21, 2018

As discussed in the Kubernetes CSI working group, each sidecar
container should document the RBAC definitions that are needed to
run the sidecar app.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 21, 2018
@pohly
Copy link
Copy Markdown
Contributor Author

pohly commented Oct 21, 2018

This rbac.yaml file is identical to the one in the E2E PR kubernetes/kubernetes#69868

A similar PR was filed against external-provisioner (kubernetes-csi/external-provisioner#156).

@pohly
Copy link
Copy Markdown
Contributor Author

pohly commented Oct 31, 2018

/assign @msau

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@pohly: GitHub didn't allow me to assign the following users: msau.

Note that only kubernetes-csi members and repo collaborators can be assigned.
For more information please see the contributor guide

Details

In response to this:

/assign @msau

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@msau42
Copy link
Copy Markdown
Contributor

msau42 commented Oct 31, 2018

/assign

Comment thread deploy/kubernetes/rbac.yaml Outdated
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "update", "patch"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does driver-registrar still need to patch nodes? With kubelet plugin watcher, I believe the driver registrar doesn't update node objects anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I haven't tried it, but you are probably right.

Do we need two rbac.yaml files then (one for registrar with --kubelet-plugin-path, one without), or do we only document the mode with --kubelet-plugin-path?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmmm I guess we technically still need to support the old way until we deprecate and remove it, so 2 manifests may be needed for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we have an issue open to make --kubelet-plugin-path a required argument? We wanted to remove the Node permissions ASAP for security reasons so I think it should be fairly high priority to deprecate the "old way."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's mainly that we need to deprecate the old registration mechanism in Kubernetes. And then we can remove it after two releases. I suppose we could remove it immediately from the sidecars if we say some X version of the sidecar does not support an older Kubernetes version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How about this?

  • a single .rbac file
  • the "nodes" commented out with a comment explaining that this is only needed when running without --kubelet-plugin-path

This is similar to (but not quite the same) how the optional leadership feature is handled in external-attacher and external-provisioner: https://github.com/kubernetes-csi/external-attacher/blob/5b2ae23a80b5e727f7d4bd8aadef2be3f2c4817e/deploy/kubernetes/rbac.yaml#L54-L65

The difference is that the external-attacher/provisioner have an optional Role, which was needed because the permissions are restricted to the namespace. We could split out the "nodes" access into a separate ClusterRole, but as this is going to be phased out, I consider that overkill.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good to me

pohly added a commit to pohly/kubernetes that referenced this pull request Nov 2, 2018
In the review of
kubernetes-retired/driver-registrar#69 it was
pointed out that the "nodes" permissions are not longer needed.
As discussed in the Kubernetes CSI working group, each sidecar
container should document the RBAC definitions that are needed to
run the sidecar app.
@pohly
Copy link
Copy Markdown
Contributor Author

pohly commented Nov 2, 2018

/hold

Let's wait for clean test results in kubernetes/kubernetes#70582 before merging, just to be absolutely sure that it works. I wasn't able to test locally, hack/local-up-cluster.sh failed for me in Kubernetes master.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2018
@pohly
Copy link
Copy Markdown
Contributor Author

pohly commented Nov 2, 2018

/hold cancel

@msau42: kubernetes/kubernetes#70582 is about to be merged, let's do the same here.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2018
@msau42
Copy link
Copy Markdown
Contributor

msau42 commented Nov 2, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2018
Copy link
Copy Markdown
Contributor

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pohly, saad-ali

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 2, 2018
@k8s-ci-robot k8s-ci-robot merged commit 87d0059 into kubernetes-retired:master Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants