1
0
Fork 0
home-stack-kustomize/kustomize/bases/grafana/grafana-deployment.yaml

114 lines
2.9 KiB
YAML
Raw Normal View History

2020-05-18 18:55:58 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
2020-05-18 20:18:39 +00:00
name: grafana
2020-05-31 22:05:21 +00:00
labels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: grafana
2020-05-18 18:55:58 +00:00
spec:
2021-08-26 16:42:48 +00:00
replicas: 1 # we can only have 1 replica for as long as the database is sqlite
strategy:
type: Recreate
2020-05-18 18:55:58 +00:00
selector:
matchLabels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: grafana
2020-05-18 18:55:58 +00:00
template:
metadata:
labels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: grafana
2020-05-18 18:55:58 +00:00
spec:
containers:
- name: grafana
image: grafana/grafana
env:
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
2021-08-26 16:42:28 +00:00
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
2020-05-18 18:55:58 +00:00
ports:
- name: http
containerPort: 3000
2021-08-26 16:42:28 +00:00
resources:
requests:
cpu: 250m
memory: 750Mi
2021-08-26 16:42:44 +00:00
limits:
cpu: 500m
memory: 1Gi
2020-05-18 18:55:58 +00:00
volumeMounts:
- name: grafana-datasources
mountPath: /etc/grafana/provisioning/datasources
2021-08-26 16:42:28 +00:00
- mountPath: /var/lib/grafana
name: grafana-pv
2020-05-18 18:55:58 +00:00
volumes:
- name: grafana-datasources
configMap:
name: grafana-datasources
2021-08-26 16:42:28 +00:00
- name: grafana-pv
persistentVolumeClaim:
claimName: grafana-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
2020-05-18 18:55:58 +00:00
---
apiVersion: v1
kind: Service
metadata:
name: grafana
2020-05-31 22:05:21 +00:00
labels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: grafana
monitor: prometheus
2020-05-18 18:55:58 +00:00
spec:
selector:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: grafana
2020-05-18 18:55:58 +00:00
ports:
- name: http
port: 3000
2020-08-02 03:40:27 +00:00
targetPort: http