Hi, I’m trying to use datasources secrets as environment variables in k8s and I have problem with secret which is as certificate. If I paste it as plain text it works but not works with environment variable, others datasources works correctly.
Working config:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: prometheus
type: prometheus
url: http://prometheus-operated:9090/
access: proxy
isDefault: true
- name: "Google Cloud Monitoring"
type: stackdriver
access: proxy
jsonData:
tokenUri: "https://oauth2.googleapis.com/token"
clientEmail: ${grafana_cloud_monitoring_email}
authenticationType: "jwt"
defaultProject: ${grafana_cloud_monitoring_project}
secureJsonData:
privateKey: |
-----BEGIN PRIVATE KEY-----
key
-----END PRIVATE KEY-----
Not working config.
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: prometheus
type: prometheus
url: http://prometheus-operated:9090/
access: proxy
isDefault: true
- name: "Google Cloud Monitoring"
type: stackdriver
access: proxy
jsonData:
tokenUri: "https://oauth2.googleapis.com/token"
clientEmail: ${grafana_cloud_monitoring_email}
authenticationType: "jwt"
defaultProject: ${grafana_cloud_monitoring_project}
secureJsonData:
privateKey: ${grafana_cloud_monitoring_private_key}
How can I add privateKey as env variable when it is as certifcate? With one line secrets it works.