我正在使用 grafana 运算符来设置 Opensearch 数据源。根据 api 文档,该字段不能在规范下设置如下:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
spec:
datasource:
withCredentials: true
但是,如果您在单击
Save & Test
时检查数据源配置页面,您可以看到这个 withCredentials
字段:
我尝试将其放入 jsonData (参见屏幕)和 secureJsonData (给我一个错误)中,看看是否会被考虑在内,但事实并非如此:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
spec:
datasource:
jsonData:
withCredentials: true
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
spec:
datasource:
secureJsonData:
withCredentials: true
有谁知道如何使用 grafana 运算符将此字段设置为 true ?
也许这会有所帮助,请尝试一下。
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
spec:
valuesFrom:
- targetPath: "basicAuthUser"
valueFrom:
secretKeyRef:
name: "grafana-opensearch-secrets"
key: "OPENSEARCH_USERNAME"
- targetPath: "secureJsonData.basicAuthPassword"
valueFrom:
secretKeyRef:
name: "grafana-opensearch-secrets"
key: "OPENSEARCH_PASSWORD"
datasource:
basicAuthUser: ${OPENSEARCH_USERNAME}
securejsonData:
"basicAuthPassword": ${OPENSEARCH_PASSWORD}