@@ -109,24 +109,22 @@ kubectl apply -n coder-workspaces -f - <<EOF
109
109
apiVersion: v1
110
110
kind: ServiceAccount
111
111
metadata:
112
- # Must be different than the Coder control plane service account, so prevent duplicates.
113
- name: coder-2
112
+ name: coder-v2
114
113
---
115
114
apiVersion: v1
116
115
kind: Secret
117
116
metadata:
118
- name: coder-service-account-token
117
+ name: coder-v2
119
118
annotations:
120
- kubernetes.io/service-account.name: coder
119
+ kubernetes.io/service-account.name: coder-v2
121
120
type: kubernetes.io/service-account-token
122
121
---
123
122
apiVersion: rbac.authorization.k8s.io/v1
124
123
kind: Role
125
124
metadata:
126
- # Must be different than the Coder control plane service account, so prevent duplicates.
127
- name: coder-2
125
+ name: coder-v2
128
126
rules:
129
- - apiGroups: ["", "apps", "networking.k8s.io"] # "" indicates the core API group
127
+ - apiGroups: ["", "apps", "networking.k8s.io"]
130
128
resources: ["persistentvolumeclaims", "pods", "deployments", "services", "secrets", "pods/exec","pods/log", "events", "networkpolicies", "serviceaccounts"]
131
129
verbs: ["create", "get", "list", "watch", "update", "patch", "delete", "deletecollection"]
132
130
- apiGroups: ["metrics.k8s.io", "storage.k8s.io"]
@@ -136,25 +134,24 @@ rules:
136
134
apiVersion: rbac.authorization.k8s.io/v1
137
135
kind: RoleBinding
138
136
metadata:
139
- # Must be different than the Coder control plane service account, so prevent duplicates.
140
- name: coder-2
137
+ name: coder-v2
141
138
subjects:
142
139
- kind: ServiceAccount
143
- name: coder
140
+ name: coder-v2
144
141
roleRef:
145
142
kind: Role
146
- name: coder
143
+ name: coder-v2
147
144
apiGroup: rbac.authorization.k8s.io
148
145
EOF
149
146
` ` `
150
147
151
148
The output should be similar to :
152
149
153
150
` ` ` text
154
- serviceaccount/coder created
155
- secret/coder-service-account-token created
156
- role.rbac.authorization.k8s.io/coder created
157
- rolebinding.rbac.authorization.k8s.io/coder created
151
+ serviceaccount/coder-v2 created
152
+ secret/coder-v2 created
153
+ role.rbac.authorization.k8s.io/coder-v2 created
154
+ rolebinding.rbac.authorization.k8s.io/coder-v2 created
158
155
` ` `
159
156
160
157
# ## 2. Modify the Kubernetes template
@@ -206,9 +203,9 @@ export CLUSTER_ADDRESS=https://example.domain:6443
206
203
To fetch the CA certificate and token :
207
204
208
205
` ` ` shell
209
- export CLUSTER_CA_CERTIFICATE=$(kubectl get secrets coder-service-account-token -n coder-workspaces -o jsonpath="{.data.ca\. crt}")
206
+ export CLUSTER_CA_CERTIFICATE=$(kubectl get secrets coder-v2 -n coder-workspaces -o jsonpath="{.data.ca\. crt}")
210
207
211
- export CLUSTER_SERVICEACCOUNT_TOKEN=$(kubectl get secrets coder-service-account-token -n coder-workspaces -o jsonpath="{.data.token}")
208
+ export CLUSTER_SERVICEACCOUNT_TOKEN=$(kubectl get secrets coder-v2 -n coder-workspaces -o jsonpath="{.data.token}")
212
209
` ` `
213
210
214
211
Create the template with these values :
0 commit comments