Skip to content

Commit d0cd6e4

Browse files
authored
Update metrics doc token creation (#1422)
Signed-off-by: David Kwon <[email protected]>
1 parent 46ecfee commit d0cd6e4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/grafana/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ To quickly test metrics locally (without installing Prometheus Grafana in the cl
1515
```
1616
2. Get the serviceaccount's token to enable local access to metrics
1717
```bash
18-
TOKEN=$(kubectl get secrets -o=json -n ${NAMESPACE} | jq -r '[.items[] |
19-
select (
20-
.type == "kubernetes.io/service-account-token" and
21-
.metadata.annotations."kubernetes.io/service-account.name" == "devworkspace-controller-serviceaccount")][0].data.token' \
22-
| base64 --decode)
18+
TOKEN=$(kubectl create token devworkspace-controller-serviceaccount -n ${NAMESPACE} --duration=1h)
2319
```
20+
NOTE: For development purposes, a non-expiring token can be created instead: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-a-long-lived-api-token-for-a-serviceaccount
2421
3. In another terminal, use `kubectl port-forward` to expose the controller's service locally
2522
```bash
2623
kubectl port-forward service/devworkspace-controller-metrics 8443:8443 &

0 commit comments

Comments
 (0)