Skip to content

Allow developers to read Kubernetes clusters

Brian Williams requested to merge 347471-update-cluster-permissions into master

What does this MR do and why?

Describe in detail what your merge request does and why.

In !75797 (merged) we started associating security vulnerabilities with Kubernetes clusters via GraphQL. Vulnerabilities require developer permissions to view, while clusters require maintainer permissions to review. It doesn't make sense to be allowed to see the vulnerabilities in a cluster, but not other information about the cluster. So, this change makes cluster information available to developers. This problem is further described in #347471 (closed).

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

Test Case Screenshot
As a developer, Kubernetes Clusters are visible in the project nav bar Screen_Shot_2021-12-29_at_8.49.31_AM
Viewing Kubernetes Clusters index as a developer Screen_Shot_2022-01-04_at_1.22.42_PM
Viewing Kubernetes Clusters index as a maintainer Screen_Shot_2022-01-04_at_1.22.01_PM
Viewing Agents tab as a developer Screen_Shot_2022-01-04_at_1.23.53_PM
Viewing Agents tab as a maintainer Screen_Shot_2022-01-04_at_1.24.56_PM
Viewing a cluster agent page as a developer Screen_Shot_2021-12-29_at_9.06.23_AM
Viewing cluster agent tokens as a developer Screen_Shot_2021-12-29_at_9.06.39_AM

How to set up and validate locally

  1. Enable KAS in gdk.yml:

    gitlab_k8s_agent:
      enabled: true
  2. Login as the user who will own the project (I used root)

  3. Create a new project

  4. Setup a new agent on the project (Steps 1-3. 4 might be optional)

  5. Go to Project Information -> Members and add another user to the project as a developer

  6. Log out and log in as the developer user

  7. Go to the project

  8. Go to Infrastructure -> Kubernetes Clusters

  9. Observe that you can browse agent information

  10. Observe that create / update / delete buttons are disabled

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #347471 (closed)

Edited by Brian Williams

Merge request reports