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