Skip to content

Update metrics doc token creation #1422

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
7 changes: 2 additions & 5 deletions docs/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ To quickly test metrics locally (without installing Prometheus Grafana in the cl
```
2. Get the serviceaccount's token to enable local access to metrics
```bash
TOKEN=$(kubectl get secrets -o=json -n ${NAMESPACE} | jq -r '[.items[] |
select (
.type == "kubernetes.io/service-account-token" and
.metadata.annotations."kubernetes.io/service-account.name" == "devworkspace-controller-serviceaccount")][0].data.token' \
| base64 --decode)
TOKEN=$(kubectl create token devworkspace-controller-serviceaccount -n ${NAMESPACE} --duration=1h | base64 --decode)
```
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
3. In another terminal, use `kubectl port-forward` to expose the controller's service locally
```bash
kubectl port-forward service/devworkspace-controller-metrics 8443:8443 &
Expand Down
Loading