-
Notifications
You must be signed in to change notification settings - Fork 370
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
Ensure that build/charts/antrea/templates/antctl/clusterrole.yaml
is up-to-date and stays up-to-date
#5136
Labels
area/component/antctl
Issues or PRs releated to the command line interface component
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone
Comments
antoninbas
added
area/component/antctl
Issues or PRs releated to the command line interface component
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
labels
Jun 16, 2023
Some permissions are also incorrect. The Antrea monitoring CRDs don't have the correct name: antrea/build/charts/antrea/templates/antctl/clusterrole.yaml Lines 29 to 30 in 1ca159f
It should be (the API group is also wrong...) |
antoninbas
added a commit
to antoninbas/antrea
that referenced
this issue
Jun 21, 2023
The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle. We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future. A few other improvements were implemented in that process: * antctl now uses the typed SystemBundle K8s clientset, instead of a raw REST client. This helps define the correct RBAC permissions for antctl. Previous permissions were indeed incorrect as they used the "post" verb (instead of the "create" verb), which is only correct for non-resource endpoints. * supportbundle unit tests now use an in-memory filesystem, to avoid writing test outputs to the local machine. * the antctl ClusterRole is giving access to a few extra endpoints ("/metrics", "/debug/pprof/*") to increse the usefulness of the antctl proxy command. Fixes antrea-io#5136 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
to antoninbas/antrea
that referenced
this issue
Jun 21, 2023
The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle. We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future. A few other improvements were implemented in that process: * antctl now uses the typed SystemBundle K8s clientset, instead of a raw REST client. This helps define the correct RBAC permissions for antctl. Previous permissions were indeed incorrect as they used the "post" verb (instead of the "create" verb), which is only correct for non-resource endpoints. * supportbundle unit tests now use an in-memory filesystem, to avoid writing test outputs to the local machine. * the antctl ClusterRole is giving access to a few extra endpoints ("/metrics", "/debug/pprof/*") to increse the usefulness of the antctl proxy command. Fixes antrea-io#5136 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
to antoninbas/antrea
that referenced
this issue
Jun 30, 2023
The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle. We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future. A few other improvements were implemented in that process: * antctl now uses the typed SystemBundle K8s clientset, instead of a raw REST client. This helps define the correct RBAC permissions for antctl. Previous permissions were indeed incorrect as they used the "post" verb (instead of the "create" verb), which is only correct for non-resource endpoints. * supportbundle unit tests now use an in-memory filesystem, to avoid writing test outputs to the local machine. * the antctl ClusterRole is giving access to a few extra endpoints ("/metrics", "/debug/pprof/*") to increse the usefulness of the antctl proxy command. Fixes antrea-io#5136 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
to antoninbas/antrea
that referenced
this issue
Jul 3, 2023
The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle. We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future. A few other improvements were implemented in that process: * antctl now uses the typed SystemBundle K8s clientset, instead of a raw REST client. This helps define the correct RBAC permissions for antctl. Previous permissions were indeed incorrect as they used the "post" verb (instead of the "create" verb), which is only correct for non-resource endpoints. * supportbundle unit tests now use an in-memory filesystem, to avoid writing test outputs to the local machine. * the antctl ClusterRole is giving access to a few extra endpoints ("/metrics", "/debug/pprof/*") to increse the usefulness of the antctl proxy command. Fixes antrea-io#5136 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
that referenced
this issue
Jul 5, 2023
* Fix RBAC permissions for the Antctl ClusterRole The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle. We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future. A few other improvements were implemented in that process: * antctl now uses the typed SystemBundle K8s clientset, instead of a raw REST client. This helps define the correct RBAC permissions for antctl. Previous permissions were indeed incorrect as they used the "post" verb (instead of the "create" verb), which is only correct for non-resource endpoints. * supportbundle unit tests now use an in-memory filesystem, to avoid writing test outputs to the local machine. * the antctl ClusterRole is giving access to a few extra endpoints ("/metrics", "/debug/pprof/*") to increse the usefulness of the antctl proxy command. Fixes #5136 * Antctl test e2e improvements * Don't use ~ (home dir) in antctl e2e tests with Kind '~' is not expanded with docker exec Signed-off-by: Antonin Bas <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/component/antctl
Issues or PRs releated to the command line interface component
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
I think we should either add a e2e test to actually validate each command can be executed correctly with an account bound to the clusterrole, or we should remove the clusterrole. But the latter means user can only use admin account to operate antctl, which may be a not good practice. I incline to the former.
Originally posted by @tnqn in #5135 (comment)
The text was updated successfully, but these errors were encountered: