File tree Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ kubectl get pods --namespace longhorn-system --watch
174
174
kubectl get storageclass
175
175
```
176
176
177
- ### Set up k8s dashboard
177
+ ### Set up k8s dashboard (Optional)
178
178
179
179
The Kubernetes dashboard is a web-based Kubernetes user interface.
180
180
As per < https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/ > it can be installed into the cluster as follows:
@@ -189,9 +189,38 @@ To access the gui through a browser on `https://localhost:8080/`:
189
189
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8080:443
190
190
```
191
191
192
- To generate a bearer token:
192
+ To generate a bearer token in order to log in - first create a Service Account :
193
193
```
194
- kubectl create token default
194
+ kubectl apply -f - <<EOF
195
+ apiVersion: v1
196
+ kind: ServiceAccount
197
+ metadata:
198
+ name: admin-user
199
+ namespace: kubernetes-dashboard
200
+ EOF
201
+ ```
202
+
203
+ Then bind the Service Account to a role with suitable permissions:
204
+ ```
205
+ kubectl apply -f - <<EOF
206
+ apiVersion: rbac.authorization.k8s.io/v1
207
+ kind: ClusterRoleBinding
208
+ metadata:
209
+ name: admin-user
210
+ roleRef:
211
+ apiGroup: rbac.authorization.k8s.io
212
+ kind: ClusterRole
213
+ name: cluster-admin
214
+ subjects:
215
+ - kind: ServiceAccount
216
+ name: admin-user
217
+ namespace: kubernetes-dashboard
218
+ EOF
219
+ ```
220
+
221
+ Finally generate a short duration token that can be used to log in:
222
+ ```
223
+ kubectl -n kubernetes-dashboard create token admin-user
195
224
```
196
225
197
226
### Completed
You can’t perform that action at this time.
0 commit comments