The APIKey
manifest allows the creation of Grafana API keys,
that will be exposed as Kubernetes secrets.
Consider the following APIKey
:
apiVersion: k8s.kevingomez.fr/v1alpha1
kind: APIKey
metadata:
name: my-service-key
namespace: apps
spec:
role: viewer # or: 'admin', 'editor'
Check the result with:
kubectl get apikeys
Once successfully applied, a my-service-key
Kubernetes secret will be created in the apps
namespace.
The actual API key will be stored in it, under the token
key:
kubectl get secrets my-service-editor-key -n apps --template="{{ .data.token | base64decode }}"
Valid roles are:
admin
editor
viewer