Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add helm var to support RBAC for deploying workspaces in extra namespaces#19517

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rowansmithau merged 17 commits intomainfromfeat/helm_namespace_rbac_improvements
Sep 18, 2025

Conversation

rowansmithau
Copy link
Contributor

@rowansmithaurowansmithau commentedAug 25, 2025
edited
Loading

This is a feature to create Role & RoleBinding entries on a per namespace basis to support deploying workspaces in separate namespace to where Coder is deployed. The idea behind this is to avoid the creation of custom RBAC entries or the use of ClusterRoles (in order to maintain priciple of least privilege).

If you have used AI to produce some or all of this PR, please ensure you have read ourAI Contribution guidelines before submitting.

This is a blink assisted PR.

Examplehelm template withoutcoder.serviceAccount.workspaceNamespaces enabled (existing behaviour as of current release) is below. Outcome = 1 x SA, 1 x Role, 1 x RoleBinding, all in the coder (.Release.Namespace) namespace.

➜  coder git:(feat/helm_namespace_rbac_improvements) ✗ helm template -n coder coder . --set coder.image.tag=v2.25.1---...---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:  name: coder-workspace-perms  namespace: coderrules:  - 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: codersubjects:  - kind: ServiceAccount    name: "coder"roleRef:  apiGroup: rbac.authorization.k8s.io  kind: Role  name: coder-workspace-perms---

Examplehelm templatewithcoder.serviceAccount.workspaceNamespaces enabled is below. Outcome = 1 x SA, 1 x Role, 1 x RoleBinding, all in the coder (.Release.Namespace) namespace PLUS a Role and RoleBinding in thedev-ws namespace with each of the RoleBindings referencing the coder SA in the coder (.Release.Namespace) namespace:

➜  coder git:(feat/helm_namespace_rbac_improvements) ✗ helm template -n coder coder . --set coder.image.tag=v2.25.1 --set-json 'coder.serviceAccount.workspaceNamespaces=[{"name":"dev-ws","workspacePerms":true,"enableDeployments":true,"extraRules":[]}]' ---...---# Source: coder/templates/rbac.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:  name: coder-workspace-perms  namespace: coderrules:  - 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: codersubjects:  - 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: coderroleRef:  apiGroup: rbac.authorization.k8s.io  kind: Role  name: coder-workspace-perms---

… to support deploying workspaces in separate namespace to where Coder is deployed
@rowansmithaurowansmithau added the helmArea: helm chart labelAug 25, 2025
@rowansmithaurowansmithau changed the titlefeat: new helm parameter to support provisioning RBAC for deploying workspaces in additional namespacesfeat: helm var to support RBAC for deploying workspaces in extra namespacesAug 25, 2025
@rowansmithaurowansmithau changed the titlefeat: helm var to support RBAC for deploying workspaces in extra namespacesfeat: add helm var to support RBAC for deploying workspaces in extra namespacesAug 25, 2025
@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelSep 4, 2025
@rowansmithaurowansmithauforce-pushed thefeat/helm_namespace_rbac_improvements branch fromdf3b609 to28158a9CompareSeptember 8, 2025 01:11
Copy link
Member

@deansheatherdeansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good, would like to see a new test which flexes all of the new functionality for this though

Copy link
Member

@deansheatherdeansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Code looks good, and the generated RBAC looks correct as well

@rowansmithaurowansmithau merged commit6238937 intomainSep 18, 2025
33 checks passed
@rowansmithaurowansmithau deleted the feat/helm_namespace_rbac_improvements branchSeptember 18, 2025 04:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 18, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@rowansmithaurowansmithau

Labels
helmArea: helm chartstaleThis issue is like stale bread.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@rowansmithau@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp