-
Notifications
You must be signed in to change notification settings - Fork 6
/
grafana-deployment.yaml
63 lines (62 loc) · 1.92 KB
/
grafana-deployment.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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: grafana-core
namespace: monitoring
labels:
app: grafana-core
spec:
replicas: 1
template:
metadata:
labels:
app: grafana-core
spec:
nodeSelector:
LB: grafana #这里打标签了!得落到指定的机器上才能数据持久化!kubectl label nodes 192.168.10.1 LB=grafana
containers:
- image: harbor.cdd.group/platform/grafana:4.2.0
name: grafana-core
imagePullPolicy: IfNotPresent
# env:
#resources:
# limits:
# cpu: 100m
# memory: 100Mi
# requests:
# cpu: 100m
# memory: 100Mi
env:
# The following env variables set up basic auth twith the default admin user and admin password.
- name: GF_AUTH_BASIC_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "false"
# - name: GF_AUTH_ANONYMOUS_ORG_ROLE
# value: Admin
# does not really work, because of template variables in exported dashboards:
# - name: GF_DASHBOARDS_JSON_ENABLED
# value: "true"
readinessProbe:
httpGet:
path: /login
port: 3000
# initialDelaySeconds: 30
# timeoutSeconds: 1
volumeMounts:
- name: grafana-data
mountPath: /var/lib/grafana/
volumes: #这里使用了hostPath方式存储数据临时方案
- name: grafana-data
hostPath:
path: /tmp
type: Directory
# cephfs:
# monitors:
# - '192.168.10.1:6789'
# - '192.168.10.2:6789'
# - '192.168.10.3:6789'
# path: /kube-data/kube-monitor/grafana-data
# user: admin
# secretFile: /etc/ceph/cephfs-key
# readOnly: false