71 lines
1.7 KiB
YAML
71 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: grafana
|
|
labels:
|
|
app: grafana
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: grafana
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: grafana
|
|
spec:
|
|
containers:
|
|
- name: grafana
|
|
image: grafana/grafana
|
|
env:
|
|
- name: GF_AUTH_ANONYMOUS_ENABLED
|
|
value: "true"
|
|
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
|
|
value: Admin
|
|
- name: GF_DATABASE_TYPE
|
|
value: mysql
|
|
- name: GF_DATABASE_HOST
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mariadb-credentials-secret
|
|
key: host
|
|
- name: GF_DATABASE_NAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mariadb-credentials-secret
|
|
key: database
|
|
- name: GF_DATABASE_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mariadb-credentials-secret
|
|
key: username
|
|
- name: GF_DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mariadb-credentials-secret
|
|
key: password
|
|
ports:
|
|
- name: http
|
|
containerPort: 3000
|
|
volumeMounts:
|
|
- name: grafana-datasources
|
|
mountPath: /etc/grafana/provisioning/datasources
|
|
volumes:
|
|
- name: grafana-datasources
|
|
configMap:
|
|
name: grafana-datasources
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: grafana
|
|
labels:
|
|
app: grafana
|
|
monitor: main
|
|
spec:
|
|
selector:
|
|
app: grafana
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: 3000
|
|
targetPort: http |