112 lines
2.9 KiB
YAML
112 lines
2.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: grafana
|
|
labels:
|
|
app.kubernetes.io/name: grafana
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: grafana
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: grafana
|
|
spec:
|
|
containers:
|
|
- name: grafana
|
|
image: grafana/grafana
|
|
env:
|
|
- name: GF_AUTH_ANONYMOUS_ENABLED
|
|
value: "true"
|
|
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
|
|
value: Viewer
|
|
# - name: GF_DATABASE_TYPE
|
|
# value: postgres
|
|
# - name: GF_DATABASE_HOST
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: host
|
|
# - name: GF_DATABASE_NAME
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: database
|
|
# - name: GF_DATABASE_USER
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: username
|
|
# - name: GF_DATABASE_PASSWORD
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: password
|
|
readinessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /robots.txt
|
|
port: 3000
|
|
scheme: HTTP
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
successThreshold: 1
|
|
timeoutSeconds: 2
|
|
livenessProbe:
|
|
failureThreshold: 3
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
tcpSocket:
|
|
port: 3000
|
|
timeoutSeconds: 1
|
|
ports:
|
|
- name: http
|
|
containerPort: 3000
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 750Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 1Gi
|
|
volumeMounts:
|
|
- name: grafana-datasources
|
|
mountPath: /etc/grafana/provisioning/datasources
|
|
- mountPath: /var/lib/grafana
|
|
name: grafana-pv
|
|
volumes:
|
|
- name: grafana-datasources
|
|
configMap:
|
|
name: grafana-datasources
|
|
- name: grafana-pv
|
|
persistentVolumeClaim:
|
|
claimName: grafana-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: grafana-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: grafana
|
|
labels:
|
|
app.kubernetes.io/name: grafana
|
|
monitor: prometheus
|
|
spec:
|
|
selector:
|
|
app.kubernetes.io/name: grafana
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: 3000
|
|
targetPort: http |