您能帮助我如何访问: 掌舵图中的数据库密码?
我尝试了这个:
"{{ .Values "grafana.ini" database.name }}"
和许多其他修改,但这些修改都不适合我。
grafana.ini:
paths:
data: /var/lib/grafana/data
logs: /var/log/grafana
plugins: /var/lib/grafana/plugins
analytics:
check_for_updates: true
log:
mode: console
grafana_net:
url: https://grafana.net
server:
database:
type: postgres
host: "127.0.0.1"
name: name
user: myuser
password: pass
答案 0 :(得分:2)
这是 answer :
initContainers:
- name: init
image: init:v0.0.1
env:
- name: DB_NAME
value: {{ (index .Values "grafana.ini" "database" "name" ) }}
- name: DB_USER
value: {{ (index .Values "grafana.ini" "database" "user" ) }}
- name: DB_PASS
value: {{ (index .Values "grafana.ini" "database" "password" ) }}
- name: SERVICE_DB_USER
value: "{{ .Values.serviceDbUser }}"
- name: REAL_DB_HOST
value: "{{ .Values.realDbHost }}"
- name: SERVICE_DB_PASS
value: "{{ .Values.serviceDbPass }}"
我是从Slack官方Kubernetes频道获得的。
希望对其他人有帮助。