-
Notifications
You must be signed in to change notification settings - Fork 0
/
grafana-deployment.yaml
162 lines (160 loc) · 5.23 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
namespace: monitoring
spec:
selector:
matchLabels:
k8s-app: grafana
replicas: 1
template:
metadata:
labels:
k8s-app: grafana
# annotations:
# backup.velero.io/backup-volumes: 'grafana-storage dashboards-volume dashboard-provider datasources-provider'
#added for deployment on system-node
spec:
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: dedicated
# operator: In
# values:
# - system-node
# tolerations:
# - key: "dedicated"
# operator: "Equal"
# value: "system-node"
# effect: "NoExecute"
initContainers:
- name: copy-ro-scripts
image: busybox
command: ['sh', '-c', 'chmod 0777 /var/lib/grafana']
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
readOnly: false
# nodeSelector:
# system: node
containers:
- name: grafana
image: grafana/grafana:7.0.3
ports:
- containerPort: 3000
protocol: TCP
volumeMounts:
- name: dashboards-volume
mountPath: /var/lib/grafana/dashboards
- name: dashboard-provider
mountPath: /etc/grafana/provisioning/dashboards
- name: datasources-provider
mountPath: /etc/grafana/provisioning/datasources
- mountPath: /var/lib/grafana
name: grafana-storage
# - mountPath: /etc/ssl/certs
# name: postgres-cert
- mountPath: /etc/ssl/certs
name: client-cert
- mountPath: /etc/ssl/key
name: client-key
- mountPath: /etc/ssl/ca
name: client-ca
env:
- name: GF_USERS_AUTO_ASSIGN_ORG_ID
valueFrom:
configMapKeyRef:
name: grafana-orgs
key: orgId
- name: GF_SERVER_HTTP_PORT
value: "3000"
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: grafana-pwd
key: password
- name: GF_INSTALL_PLUGINS
value: "grafana-piechart-panel,devopsprodigy-kubegraf-app"
- name: GF_SERVER_ROOT_URL
value: "https://grafana.huawei.dev.acf-cr.atos.net"
- name: GF_AUTH_GENERIC_OAUTH_NAME
value: "UAA"
- name: GF_AUTH_GENERIC_OAUTH_ENABLED
value: "True"
- name: GF_AUTH_GENERIC_OAUTH_ALLOW_SIGN_UP
value: "True"
- name: GF_AUTH_GENERIC_OAUTH_CLIENT_ID
value: "cfcr-control-plane-uaa"
- name: GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET
value: "cfcr-control-plane-uaa"
- name: GF_AUTH_GENERIC_OAUTH_SCOPES
value: "openid profile email offline_access"
- name: GF_AUTH_GENERIC_OAUTH_AUTH_URL
value: "https://uaa.huawei.dev.acf-cr.atos.net/oauth/authorize"
- name: GF_AUTH_GENERIC_OAUTH_TOKEN_URL
value: "https://uaa.huawei.dev.acf-cr.atos.net/oauth/token"
- name: GF_AUTH_GENERIC_OAUTH_API_URL
value: "https://uaa.huawei.dev.acf-cr.atos.net/userinfo"
- name: GF_AUTH_GENERIC_OAUTH_TLS_SKIP_VERIFY_INSECURE
value: "false"
- name: GF_AUTH_GENERIC_OAUTH_TLS_CLIENT_CERT
value: "/etc/ssl/certs/client.crt"
- name: GF_AUTH_GENERIC_OAUTH_TLS_CLIENT_KEY
value: "/etc/ssl/key/client.key"
- name: GF_AUTH_GENERIC_OAUTH_TLS_CLIENT_CA
value: "/etc/ssl/ca/client_ca.crt"
- name: GF_SERVER_CERT_FILE
value: "/var/lib/grafana/ssl/grafana.crt"
- name: GF_SERVER_CERT_KEY
value: "/var/lib/grafana/ssl/grafana.key"
# - name: GF_DATABASE_TYPE
# value: "postgres"
# - name: GF_DATABASE_HOST
# value: "postgres.service.cfcr-client.internal" #"10.20.2.10:5432"
# - name: GF_DATABASE_NAME
# value: "grafana"
# - name: GF_DATABASE_USER
# value: "grafana"
# - name: GF_DATABASE_PASSWORD
# value: "grafana123"
# - name: GF_DATABASE_SSL_MODE
# value: "require"
# - name: GF_DATABASE_CA_CERT_PATH
# value: "/etc/ssl/certs/pg_ca_cert.crt"
# nodeSelector:
# system: node
volumes:
- name: grafana-storage
persistentVolumeClaim:
claimName: grafana-volume-claim
# emptyDir: {}
- name: dashboards-volume
configMap:
name: grafana-dashs
- name: dashboard-provider
configMap:
name: grafana-dash-provider
items:
- key: providers.yaml
path: providers.yaml
- name: datasources-provider
configMap:
name: grafana-datasources-provider
items:
- key: providers.yaml
path: providers.yaml
# - name: postgres-cert
# configMap:
# name: postgres-configmap
- name: client-cert
configMap:
name: client-cert-configmap
- name: client-key
configMap:
name: client-key-configmap
- name: client-ca
configMap:
name: client-ca-configmap