-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Define CRDs for ServiceRole and ServiceRoleBinding in pilot #4246
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
Conversation
1. create corresponding CRD for ServiceRole and ServiceRoleBinding (See https://github.com/istio/api/blob/master/rbac/v1alpha1/rbac.proto). The ServiceRole and ServiceRoleBinding is currently defined in istio-auth.yaml but we have plans to migrate them to pilot for the local RBAC. 2. add corresponding validation code for new model types (istio#3927).
Codecov Report
@@ Coverage Diff @@
## master #4246 +/- ##
=======================================
- Coverage 74% 74% -<1%
=======================================
Files 313 313
Lines 29039 28968 -71
=======================================
- Hits 21269 21164 -105
- Misses 6451 6490 +39
+ Partials 1319 1314 -5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks.
The code LGTM. General question: what does Pilot do with this new configuration, i.e. who is the consumer? |
Thanks for the review! Currently pilot doesn't handle the new configuration other than the validation (both in admission controller and istioctl). There is a RBAC mixer adapter to consume these actual resources and apply the corresponding RBAC rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ayj The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
Automatic merge from submit-queue. Rerun generate_config_crd_types.go to update ServiceRole and ServiceRoleBinding types. Change #4246 might use the old script when generate types for the new CRDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think also need to register the new proto schema to istioctl if you want that tool to check it (yeah, I know ;))
https://github.com/istio/istio/blob/master/istioctl/cmd/istioctl/main.go#L650
Type: "service-role", | ||
Plural: "service-roles", | ||
Group: "config", | ||
Version: istioAPIVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be you should use separate api group (e.g 'authorization'), with your actual api version + @xiaolanz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, if this is a new CRD, it should be in group= "rbac" and version= v1alpha1 to follow API style guide https://github.com/istio/api/blob/master/STYLE-GUIDE.md#crd-versioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a new CRD, it's currently defined here (group='config' and version='v1alpha2').
@diemtvu Thanks for catching this! |
create corresponding CRD for ServiceRole and ServiceRoleBinding (See
https://github.com/istio/api/blob/master/rbac/v1alpha1/rbac.proto).
The ServiceRole and ServiceRoleBinding is currently defined in istio-auth.yaml
but we have plans to migrate them to pilot for the local RBAC.
add corresponding validation code for new model types (Validation for Istio RBAC policies #3927).
in longer term after the local RBAC is implemented, the pilot watches for changes on Istio RBAC policies, fetches the updated RBAC policies from Istio Config Store and distributes relevant Istio RBAC policies to Envoy proxies that are co-located with service instances and enforce the policies inside Envoy (The mixer won't handle the RBAC policies anymore).
See the design doc (WIP) for more details: https://docs.google.com/document/d/1XkN9ls-ZDISz2uXGN20RaIre63DkJJOJNUOzcKCxbWA/edit?usp=sharing