84 lines
2.0 KiB
YAML
84 lines
2.0 KiB
YAML
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: grafana-deployment
|
||
|
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
|
||
|
value: mariadb.monitoring.svc:3306
|
||
|
- 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
|
||
|
spec:
|
||
|
selector:
|
||
|
app: grafana
|
||
|
ports:
|
||
|
- name: http
|
||
|
protocol: TCP
|
||
|
port: 3000
|
||
|
targetPort: http
|
||
|
---
|
||
|
apiVersion: networking.k8s.io/v1beta1
|
||
|
kind: Ingress
|
||
|
metadata:
|
||
|
name: grafana-ingress
|
||
|
annotations:
|
||
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
||
|
cert-manager.io/cluster-issuer: letsencrypt
|
||
|
spec:
|
||
|
tls:
|
||
|
- hosts:
|
||
|
- grafana.127.0.0.1.nip.io
|
||
|
secretName: letsencrypt-cert
|
||
|
rules:
|
||
|
- host: grafana.127.0.0.1.nip.io
|
||
|
http:
|
||
|
paths:
|
||
|
- path: /
|
||
|
backend:
|
||
|
serviceName: grafana
|
||
|
servicePort: http
|