Skip to content

Commit 071d555

Browse files
committed
Made hard coded secrets into variables
1 parent 51fa765 commit 071d555

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

examples/k8s/monitoring/grafana.yaml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: grafana-credentials
5+
namespace: agentaflow-monitoring
6+
labels:
7+
app: grafana
8+
type: Opaque
9+
data:
10+
admin-user: YWRtaW4= # base64 encoded 'admin'
11+
admin-password: YWdlbnRhZmxvdzEyMw== # base64 encoded 'agentaflow123'
12+
---
13+
apiVersion: v1
214
kind: ConfigMap
315
metadata:
416
name: grafana-config
@@ -12,9 +24,8 @@ data:
1224
1325
[grafana_net]
1426
url = https://grafana.net
15-
16-
[log]
17-
mode = console
27+
[security]
28+
# admin credentials are set via environment variables
1829
1930
[paths]
2031
data = /var/lib/grafana/data
@@ -213,15 +224,21 @@ spec:
213224
spec:
214225
containers:
215226
- name: grafana
216-
image: grafana/grafana:9.5.0
227+
image: grafana/grafana:latest
217228
ports:
218229
- containerPort: 3000
219230
name: web
220231
env:
221232
- name: GF_SECURITY_ADMIN_USER
222-
value: "admin"
233+
valueFrom:
234+
secretKeyRef:
235+
name: grafana-credentials
236+
key: admin-user
223237
- name: GF_SECURITY_ADMIN_PASSWORD
224-
value: "agentaflow123"
238+
valueFrom:
239+
secretKeyRef:
240+
name: grafana-credentials
241+
key: admin-password
225242
- name: GF_USERS_ALLOW_SIGN_UP
226243
value: "false"
227244
volumeMounts:

0 commit comments

Comments
 (0)