This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grafana_for_kubeflow.yaml
141 lines (140 loc) · 3.07 KB
/
grafana_for_kubeflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
apiVersion: v1
kind: PersistentVolume
metadata:
name: grafana-pv
labels:
name: grafana-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
nfs:
server: {your nfs server}
path: {your nfs path}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-pvc
namespace: monitor
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
selector:
matchLabels:
name: grafana-pv
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-config
namespace: monitor
labels:
app: grafana
chart: grafana
heritage: Tiller
release: istio
istio: grafana
data:
grafana.ini: |-
[server]
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
serve_from_sub_path = true
[auth.anonymous]
enabled = true
[auth.proxy]
enabled = true
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: grafana
namespace: monitor
spec:
replicas: 1
selector:
matchLabels:
k8s-app: grafana
template:
metadata:
labels:
k8s-app: grafana
spec:
initContainers:
- name: init-chown-data
image: alpine:3.10
imagePullPolicy: IfNotPresent
command: ["chown", "-R", "472:472", "/var/lib/grafana/"]
volumeMounts:
- name: storage
mountPath: /var/lib/grafana/
containers:
- name: grafana
image: grafana/grafana:7.3.5
env:
- name: GF_SECURITY_ADMIN_PASSWORD
value: admin
- name: GF_SECURITY_ADMIN_USER
value: admin
ports:
- containerPort: 3000
protocol: TCP
readinessProbe:
failureThreshold: 10
httpGet:
path: /grafana/api/health
port: 3000
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 30
livenessProbe:
failureThreshold: 3
httpGet:
path: /grafana/api/health
port: 3000
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 100m
memory: 256Mi
volumeMounts:
- name: grafana-configuration
mountPath: "/etc/grafana/grafana.ini"
subPath: grafana.ini
readOnly: true
- name: storage
mountPath: /var/lib/grafana
volumes:
- name: grafana-configuration
configMap:
name: grafana-config
- name: storage
persistentVolumeClaim:
claimName: grafana-pvc
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: grafana
name: grafana-service
namespace: monitor
spec:
ports:
- port: 3000
targetPort: 3000
selector:
k8s-app: grafana