Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 890 Bytes

creating-api-keys.md

File metadata and controls

41 lines (29 loc) · 890 Bytes

Creating API keys

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 }}"

Roles

Valid roles are:

  • admin
  • editor
  • viewer

That was it!

Return to the index to explore what you can do with DARK