Skip to content

Kubernetes Roles use incorrect syntax for single resources #3607

@ricky26

Description

@ricky26

Describe the bug
At the moment the Helm chart produces roles with resource set to kind/resource-name (e.g. secrets/taskcluster-ui). This causes issues when deploying from restricted service accounts where RBAC is enabled.

To Reproduce
Steps to reproduce the behavior:

  1. Use helm template on the chart in infrastructure/k8s with a valid values.yml.
  2. Look at the generated Roles.
  3. Notice that the resource field doesn't match the documentation.

Alternatively:

  1. Create a service account with appropriate roles to deploy Taskcluster (in particular all verbs for secrets).
  2. Try and deploy Taskcluster.
  3. Notice errors during deployment:
roles.rbac.authorization.k8s.io \"taskcluster-web-server-secrets-read\" is forbidden: user \"system:serviceaccount:taskcluster-operator:default\" (groups=[\"system:serviceaccounts\" \"system:serviceaccounts:taskcluster-operator\" \"system:authenticated\"]) is attempting to grant RBAC permissions not currently held:\n{APIGroups:[\"\"], Resources:[\"secrets/taskcluster-web-server\"], Verbs:[\"get\" \"watch\" \"list\"]}

Expected behavior
Kubernetes Roles should use resourceNames to specify individual resources: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources.

Taskcluster version
v37.2.0

Kubernetes Version
1.16.13-gke.401

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions