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

119 lines
3.1 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:
2021-08-28 20:32:06 +00:00
initContainers:
- name: init-ownership
image: bash:5
command: ['chown', '-R', '472:472', '/var/lib/grafana']
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-pv
2020-05-18 18:55:58 +00:00
containers:
- name: grafana
image: grafana/grafana
env:
- name: GF_AUTH_ANONYMOUS_ENABLED
2021-08-28 20:32:06 +00:00
value: "false"
2021-08-26 16:42:28 +00:00
# - name: GF_DATABASE_TYPE
# value: postgres
# - name: GF_DATABASE_HOST
# valueFrom:
# secretKeyRef:
2021-08-28 03:54:21 +00:00
# name: postgres-credentials
2021-08-26 16:42:28 +00:00
# key: host
# - name: GF_DATABASE_NAME
# valueFrom:
# secretKeyRef:
2021-08-28 03:54:21 +00:00
# name: postgres-credentials
2021-08-26 16:42:28 +00:00
# key: database
# - name: GF_DATABASE_USER
# valueFrom:
# secretKeyRef:
2021-08-28 03:54:21 +00:00
# name: postgres-credentials
2021-08-26 16:42:28 +00:00
# key: username
# - name: GF_DATABASE_PASSWORD
# valueFrom:
# secretKeyRef:
2021-08-28 03:54:21 +00:00
# name: postgres-credentials
2021-08-26 16:42:28 +00:00
# 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
2021-08-28 03:54:21 +00:00
memory: 500Mi
2021-08-26 16:42:44 +00:00
limits:
cpu: 500m
2021-08-28 03:54:21 +00:00
memory: 750Mi
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