devopsprodigy / kubegraf

Grafana-plugin for k8s' monitoring
MIT License
407 stars 45 forks source link

K8s no extra secret manifest #45

Open LittleFox94 opened 3 years ago

LittleFox94 commented 3 years ago

Currently there is a new ServiceAccount and a Secret deployed. Kubernetes creates a Secret automatically for ServiceAccounts so the additional secret isn't required.

I suspect the secret is added to have a defined name, making install instructions easier. I propose to delete the additional secret and use this command to get the token: kubectl get secret $(kubectl get sa grafana-kubegraf -o go-template='{{ (index .secrets 0).name }}') -o go-template='{{ .data.token | base64decode }}'

This retrieves the name of the first (and then only) secret for the serviceaccount and then retrieves and decoded the token from the secret

The token in it also does not seem to work in my cluster, not sure why but happy to help with debugging