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

125 lines
3.5 KiB
YAML
Raw Normal View History

2020-05-18 18:55:58 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: server
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_SERVER_DOMAIN
valueFrom:
configMapKeyRef:
name: kustomize-generated-config
key: GRAFANA_EXTERNAL_HOST
2022-08-28 22:29:26 +00:00
- name: GF_SERVER_ROOT_URL
valueFrom:
configMapKeyRef:
name: kustomize-generated-config
key: GRAFANA_EXTERNAL_URL
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: public
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
value: Viewer
2021-09-06 20:39:49 +00:00
- name: GF_INSTALL_PLUGINS
value: marcusolsson-json-datasource,marcusolsson-treemap-panel
2023-09-22 04:48:09 +00:00
- name: GF_FEATURE_TOGGLES_ENABLE
value: nestedFolders
- name: GF_AUTH_GENERIC_OAUTH_SKIP_ORG_ROLE_SYNC
value: "true"
- name: GF_AUTH_OAUTH_ALLOW_INSECURE_EMAIL_LOOKUP
value: "true"
2022-08-28 22:29:26 +00:00
args: ['--config', '/etc/grafana/provisioning/config/custom.ini']
2021-08-26 16:42:28 +00:00
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: 500m
memory: 500Mi
2021-08-26 16:42:44 +00:00
limits:
cpu: 500m
memory: 500Mi
2020-05-18 18:55:58 +00:00
volumeMounts:
- name: grafana-datasources
mountPath: /etc/grafana/provisioning/datasources
2022-08-28 22:29:26 +00:00
- name: grafana-config
mountPath: /etc/grafana/provisioning/config
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
2022-08-28 22:29:26 +00:00
- name: grafana-config
secret:
secretName: grafana-config
2021-08-26 16:42:28 +00:00
- name: grafana-pv
persistentVolumeClaim:
claimName: server-pvc
2021-08-26 16:42:28 +00:00
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: server-pvc
2021-08-26 16:42:28 +00:00
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
2020-05-18 18:55:58 +00:00
---
apiVersion: v1
kind: Service
metadata:
name: server
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