forked from OpenShiftDemos/grafana-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openshift-grafana-template.yaml
178 lines (177 loc) · 3.87 KB
/
openshift-grafana-template.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
apiVersion: v1
kind: Template
metadata:
name: grafana-openshift
parameters:
- name: GIT_URI
displayName: Git repository URI
description: location of the grafana git repo
value: https://github.com/OpenShiftDemos/grafana-openshift
- description: Github trigger secret. A difficult to guess string encoded as part
of the webhook URL. Not encrypted.
displayName: GitHub Webhook Secret
from: '[a-zA-Z0-9]{40}'
generate: expression
name: WEBHOOK_SECRET
- name: VOLUME_SIZE
displayName: Volume Size
description: Size of persistent volume used for Grafana datastore
required: true
value: 1Gi
- name: DATA_DIR
displayName: Data directory
description: Path to Grafana data directory
required: true
value: /usr/share/grafana/data
objects:
- apiVersion: v1
kind: BuildConfig
metadata:
name: grafana
spec:
output:
to:
kind: ImageStreamTag
name: grafana:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
uri: ${GIT_URI}
type: Git
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: centos:7
type: Docker
triggers:
- github:
secret: ${WEBHOOK_SECRET}
type: GitHub
- generic:
secret: ${WEBHOOK_SECRET}
type: Generic
- imageChange: {}
type: ImageChange
- type: ConfigChange
status:
lastVersion: 0
- apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
ports:
- name: 3000-tcp
port: 3000
protocol: TCP
targetPort: 3000
selector:
deploymentconfig: grafana
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Route
metadata:
name: grafana
spec:
port:
targetPort: 3000-tcp
to:
kind: Service
name: grafana
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: grafana
spec:
replicas: 1
selector:
deploymentconfig: grafana
strategy:
activeDeadlineSeconds: 21600
recreateParams:
timeoutSeconds: 600
resources: {}
type: Recreate
template:
metadata:
labels:
deploymentconfig: grafana
spec:
containers:
- env:
- name: GF_INSTALL_PLUGINS
value: hawkular-datasource
- name: DATAD
value: ${DATA_DIR}
- name: PLGND
value: ${DATA_DIR}/plugins
image: ''
imagePullPolicy: Always
name: grafana
ports:
- containerPort: 3000
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: ${DATA_DIR}
name: data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: data
persistentVolumeClaim:
claimName: conf
test: false
triggers:
- imageChangeParams:
automatic: true
containerNames:
- grafana
from:
kind: ImageStreamTag
name: grafana:latest
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: ImageStream
metadata:
name: centos
spec:
lookupPolicy:
local: false
tags:
- annotations:
openshift.io/imported-from: centos:7
from:
kind: DockerImage
name: docker.io/centos:7
importPolicy:
scheduled: true
name: "7"
referencePolicy:
type: Source
- apiVersion: v1
kind: ImageStream
metadata:
name: grafana
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: conf
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${VOLUME_SIZE}