Storing API tokens

We have Grafana running in a pod in kubernetes. I have created an API token for Grafana manually so that I can use it with an application to retrieve information.

However as a pod, Grafana could be stopped and brought up elsewhere. So when I kill Grafana, it comes back, but the tokens do not persist.

Does anyone know where the tokens are stored?
So I can either change the grafana deployment to persist them to disk, or to an external service.
I currently have a small GCE disk volume attached to Grafana deployment for /data. I had assumed they might persist there but they don’t seem to.

They are stored in the main grafana db (where users and dashboards , user preferences, annotations, teams, etc ) are stored. By default a SQLite db stored at /var/lib/grafana but can also be a MySQL or Postgres db

Thanks @torkel for replying. That makes sense, I just couldn’t find that under the api documentation.

My k8s config had the data directory mounted as an emptyDir which explains why it goes away on pod deployments / restarts. Was not actually mounting the disk.

I was trying to stick with a volume rather than en external DB, but running in k8s as a non-root user is proving really tricky at the moment. I’ll post a solutions if I get one.