closes#20562.
When I addedworkspaceNamespaces it caused an issue whenworkspacePerms is set tofalse in that the Role & RoleBinding was still created.
Update withworkspacePerms=false:
➜ coder git:(rowan/helm_rbac_fix) ✗ helm template coder . --version=2.27.2 --set coder.image.tag=v2.27.2 --set coder.serviceAccount.workspacePerms=false | grep -A11 -B46 RoleBinding➜ coder git:(rowan/helm_rbac_fix) ✗
Update withworkspacePerms=true:
➜ coder git:(rowan/helm_rbac_fix) ✗ helm template coder . --version=2.27.2 --set coder.image.tag=v2.27.2 --set coder.serviceAccount.workspacePerms=true | grep -A12 -B60 RoleBinding# Source: coder/templates/coder.yamlapiVersion: v1kind: ServiceAccountmetadata: annotations: {} labels: app.kubernetes.io/instance: coder app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: coder app.kubernetes.io/part-of: coder app.kubernetes.io/version: 0.1.0 helm.sh/chart: coder-0.1.0 name: coder namespace: default---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: name: coder-workspace-perms namespace: defaultrules: - apiGroups: [""] resources: ["pods"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: - apps resources: - deployments verbs: - create - delete - deletecollection - get - list - patch - update - watch---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata: name: "coder" namespace: defaultsubjects: - kind: ServiceAccount name: "coder"roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: coder-workspace-perms---# Source: coder/templates/service.yaml
Update withworkspacePerms=false andworkspaceNamespaces populated:
➜ coder git:(rowan/helm_rbac_fix) ✗ helm template coder . --version=2.27.2 --set coder.image.tag=v2.27.2 --set coder.serviceAccount.workspacePerms=false --set-json 'coder.serviceAccount.workspaceNamespaces=[{"name":"dev-ws","workspacePerms":true,"enableDeployments":true,"extraRules":[]}]' | grep -A15 -B105 RoleBinding---# Source: coder/templates/coder.yamlapiVersion: v1kind: ServiceAccountmetadata: annotations: {} labels: app.kubernetes.io/instance: coder app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: coder app.kubernetes.io/part-of: coder app.kubernetes.io/version: 0.1.0 helm.sh/chart: coder-0.1.0 name: coder namespace: default---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: name: coder-workspace-perms namespace: dev-wsrules: - apiGroups: [""] resources: ["pods"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: - apps resources: - deployments verbs: - create - delete - deletecollection - get - list - patch - update - watch---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata: name: "coder" namespace: dev-wssubjects: - kind: ServiceAccount name: "coder" namespace: defaultroleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: coder-workspace-perms---# Source: coder/templates/service.yamlapiVersion: v1kind: Service
Update withworkspacePerms=true andworkspaceNamespaces populated:
➜ coder git:(rowan/helm_rbac_fix) ✗ helm template coder . --version=2.27.2 --set coder.image.tag=v2.27.2 --set coder.serviceAccount.workspacePerms=true --set-json 'coder.serviceAccount.workspaceNamespaces=[{"name":"dev-ws","workspacePerms":true,"enableDeployments":true,"extraRules":[]}]' | grep -A15 -B105 RoleBinding ---# Source: coder/templates/coder.yamlapiVersion: v1kind: ServiceAccountmetadata: annotations: {} labels: app.kubernetes.io/instance: coder app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: coder app.kubernetes.io/part-of: coder app.kubernetes.io/version: 0.1.0 helm.sh/chart: coder-0.1.0 name: coder namespace: default---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: name: coder-workspace-perms namespace: defaultrules: - apiGroups: [""] resources: ["pods"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: - apps resources: - deployments verbs: - create - delete - deletecollection - get - list - patch - update - watch---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: name: coder-workspace-perms namespace: dev-wsrules: - apiGroups: [""] resources: ["pods"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: - create - delete - deletecollection - get - list - patch - update - watch - apiGroups: - apps resources: - deployments verbs: - create - delete - deletecollection - get - list - patch - update - watch---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata: name: "coder" namespace: defaultsubjects: - kind: ServiceAccount name: "coder"roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: coder-workspace-perms---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata: name: "coder" namespace: dev-wssubjects: - kind: ServiceAccount name: "coder" namespace: defaultroleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: coder-workspace-perms---# Source: coder/templates/service.yamlapiVersion: v1kind: Service➜ coder git:(rowan/helm_rbac_fix) ✗
closes#20562.
When I added
workspaceNamespacesit caused an issue whenworkspacePermsis set tofalsein that the Role & RoleBinding was still created.Update with
workspacePerms=false:Update with
workspacePerms=true:Update with
workspacePerms=falseandworkspaceNamespacespopulated:Update with
workspacePerms=trueandworkspaceNamespacespopulated: