Skip to content

docs: fix docs on deploying workspaces in additional namespaces #13724

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

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions docs/platforms/kubernetes/additional-clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,16 @@ Alternatively, these could also be fetched from Kubernetes secrets or even
This guide assumes you have a `coder-workspaces` namespace on your remote
cluster. Change the namespace accordingly.

### Create a ServiceAccount
### Create a Role and RoleBinding

Run this command against your remote cluster to create a ServiceAccount, Role,
RoleBinding, and token:
Run this command against your remote cluster to create a Role and RoleBinding:

```shell
kubectl apply -n coder-workspaces -f - <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: coder-v2
---
apiVersion: v1
kind: Secret
metadata:
name: coder-v2
annotations:
kubernetes.io/service-account.name: coder-v2
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: coder-v2
name: coder-workspaces
rules:
- apiGroups: ["", "apps", "networking.k8s.io"]
resources: ["persistentvolumeclaims", "pods", "deployments", "services", "secrets", "pods/exec","pods/log", "events", "networkpolicies", "serviceaccounts"]
Expand All @@ -134,24 +120,22 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: coder-v2
name: coder-workspaces
subjects:
- kind: ServiceAccount
name: coder-v2
name: coder
roleRef:
kind: Role
name: coder-v2
name: coder-workspaces
apiGroup: rbac.authorization.k8s.io
EOF
```

The output should be similar to:

```text
serviceaccount/coder-v2 created
secret/coder-v2 created
role.rbac.authorization.k8s.io/coder-v2 created
rolebinding.rbac.authorization.k8s.io/coder-v2 created
role.rbac.authorization.k8s.io/coder-workspaces created
rolebinding.rbac.authorization.k8s.io/coder-workspaces created
```

### 2. Modify the Kubernetes template
Expand Down
Loading