Skip to content
This repository was archived by the owner on Jun 19, 2021. It is now read-only.

Commit 23dc6d8

Browse files
author
LuciferInLove
committed
grafana-operator version updated to 3.9.0
Added configurable readiness and liveness probes for grafana custom resource Added plugins init image support for grafana custom resource Added service name configuration for grafana custom resource Added conditional serviceaccount creation for grafana custom resource
1 parent a1d9263 commit 23dc6d8

7 files changed

+135
-14
lines changed

Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: grafana-operator
3-
version: 0.1.0
4-
appVersion: 3.6.0
3+
version: 0.1.1
4+
appVersion: 3.9.0
55
kubeVersion: "^1.8.0-0"
66
description: A Kubernetes Operator based on the Operator SDK for creating and managing Grafana instances.
77
home: https://github.com/integr8ly/grafana-operator

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ helm install grafana-operator ./ --namespace grafana
4343
| operator.monitoring.relabelings | list | `[]` | ServiceMonitor endpoint relabelings. |
4444
| grafana[0].name | string | `grafana` | Name of Grafana instance. |
4545
| grafana[0].baseImage | string | `""` | Custom grafana image for the grafana deployment. Warning! This overwrites the `--grafana-image` operator flag. |
46+
| grafana[0].initImage | string | `""` | Custom grafana plugins init image for the grafana deployment. Warning! This overwrites the `--grafana-plugins-init-container-image` operator flag. |
4647
| grafana[0].containers | list | `[]` | Additional containers to add to the grafana pod. |
4748
| grafana[0].secrets | list | `[]` | Secrets to be mounted as volume into the grafana deployment. |
4849
| grafana[0].configMaps | list | `[]` | ConfigMaps to be mounted as volume into the grafana deployment. |
@@ -67,12 +68,15 @@ helm install grafana-operator ./ --namespace grafana
6768
| grafana[0].ingress.tlsSecretName | string | `""` | Name of the ingress certificate secret. |
6869
| grafana[0].ingress.termination | string | `""` | Used in Openshift, dictates where the secure communication will stop. |
6970
| grafana[0].service.enabled | bool | `true` | Defines if grafana instance's service is enabled. |
71+
| grafana[0].service.name | string | `grafana-service` | Configurable name for the grafana's service. |
7072
| grafana[0].service.ports | list | `[{"name": "grafana", "port": 3000, "protocol": "TCP", "targetPort": "grafana-http"}]` | Grafana instance's service ports. |
7173
| grafana[0].service.annotations | object | `{}` | Grafana instance's service annotations. |
7274
| grafana[0].service.labels | object | `{}` | Grafana instance's service labels. |
7375
| grafana[0].service.type | string | `ClusterIP` | Grafana instance's service type. |
76+
| grafana[0].service.clusterIP | string | `""` | Specifies your own cluster IP address for the grafana's service. |
7477
| grafana[0].client | object | `{"preferService": true}` | Grafana client settings. |
7578
| grafana[0].compat | object | `{}` | Grafana's backwards compatibility switches. |
79+
| grafana[0].serviceAccount.skip | bool | `false` | Skips the grafana's ServiceAccount creation. |
7680
| grafana[0].serviceAccount.annotations | object | `{}` | Additional annotations for ServiceAccount. |
7781
| grafana[0].serviceAccount.labels | object | `{}` | Additional labels for ServiceAccount. |
7882
| grafana[0].serviceAccount.imagePullSecrets | array | `[]` | Additional image pull secrets for ServiceAccount. |
@@ -94,5 +98,7 @@ helm install grafana-operator ./ --namespace grafana
9498
| grafana[0].dataStorage.size | string | `""` | Grafana instance's persistent volume size. |
9599
| grafana[0].dataStorage.class | string | `""` | Grafana instance's persistent volume storage class. |
96100
| grafana[0].jsonnet | object | `{}` | Label selector for jsonnet libraries. |
101+
| grafana[0].livenessProbeSpec | object | `{}` | Liveness probe configuration for the grafana container. |
102+
| grafana[0].readinessProbeSpec | object | `{}` | Readiness probe configuration for the grafana container. |
97103
| grafanaDataSource | list | `[]` | List of GrafanaDataSource objects. See an example in values.yaml. |
98104
| grafanaDashboard | list | `[]` | List of GrafanaDashboard objects. See an example in values.yaml. |

crds/grafana.yaml

+84
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ spec:
102102
service:
103103
type: object
104104
properties:
105+
name:
106+
type: string
107+
description: Override default service name
105108
ports:
106109
type: array
107110
description: Override default ports
@@ -150,6 +153,9 @@ spec:
150153
serviceAccount:
151154
type: object
152155
properties:
156+
skip:
157+
type: boolean
158+
description: Disable ServiceAccount creation for grafana
153159
annotations:
154160
type: object
155161
description: Additional annotations for the serviceaccount
@@ -199,3 +205,81 @@ spec:
199205
baseImage:
200206
type: string
201207
description: Override base image
208+
initImage:
209+
type: string
210+
description: Override plugins init image
211+
livenessProbeSpec:
212+
type: object
213+
properties:
214+
initialDelaySeconds:
215+
description: >-
216+
Number of seconds after the container has
217+
started before liveness probes are initiated. More info:
218+
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
219+
format: int32
220+
type: integer
221+
timeoutSeconds:
222+
description: Number of seconds after which the probe times out. Defaults to 1 second.
223+
Minimum value is 1.
224+
format: int32
225+
type: integer
226+
periodSeconds:
227+
description: >-
228+
How often (in seconds) to perform the probe.
229+
Default to 10 seconds. Minimum value is 1.
230+
format: int32
231+
type: integer
232+
successThreshold:
233+
description: >-
234+
Minimum consecutive successes for the probe
235+
to be considered successful after having failed. Defaults
236+
to 1. Must be 1 for liveness and startup. Minimum value
237+
is 1.
238+
format: int32
239+
type: integer
240+
failureThreshold:
241+
description: >-
242+
When a probe fails, Kubernetes will try failureThreshold times before giving up.
243+
Giving up in case of liveness probe means restarting the container.
244+
In case of readiness probe the Pod will be marked Unready.
245+
Defaults to 3. Minimum value is 1.
246+
format: int32
247+
type: integer
248+
readinessProbeSpec:
249+
type: object
250+
properties:
251+
initialDelaySeconds:
252+
description: >-
253+
Number of seconds after the container has
254+
started before liveness probes are initiated. More info
255+
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
256+
format: int32
257+
type: integer
258+
timeoutSeconds:
259+
description: >-
260+
Number of seconds after which the probe times out. Defaults to 1 second.
261+
Minimum value is 1.
262+
format: int32
263+
type: integer
264+
periodSeconds:
265+
description: >-
266+
How often (in seconds) to perform the probe.
267+
Default to 10 seconds. Minimum value is 1.
268+
format: int32
269+
type: integer
270+
successThreshold:
271+
description: >-
272+
Minimum consecutive successes for the probe
273+
to be considered successful after having failed. Defaults
274+
to 1. Must be 1 for liveness and startup. Minimum value
275+
is 1.
276+
format: int32
277+
type: integer
278+
failureThreshold:
279+
description: >-
280+
When a probe fails, Kubernetes will try failureThreshold times before giving up.
281+
Giving up in case of liveness probe means restarting the container.
282+
In case of readiness probe the Pod will be marked Unready.
283+
Defaults to 3. Minimum value is 1.
284+
format: int32
285+
type: integer

crds/grafanaDashboard.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ spec:
2323
spec:
2424
type: object
2525
properties:
26-
name:
27-
type: string
2826
json:
2927
type: string
3028
jsonnet:

templates/grafana.yaml

+24-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ items:
1313
{{- if .baseImage }}
1414
baseImage: {{ .baseImage }}
1515
{{- end }}
16+
{{- if .initImage }}
17+
initImage: {{ .initImage }}
18+
{{- end }}
1619
{{- if .containers }}
1720
containers:
1821
{{- range .containers }}
@@ -88,19 +91,25 @@ items:
8891
{{- end }}
8992
{{- if .service.enabled }}
9093
service:
91-
{{- with .service.ports }}
94+
name: {{ .service.name }}
95+
{{- with .service.ports }}
9296
ports:
9397
{{- toYaml . | nindent 8 }}
94-
{{- end }}
95-
{{- with .service.annotations }}
98+
{{- end }}
99+
{{- with .service.annotations }}
96100
annotations:
97101
{{- toYaml . | nindent 8 }}
98-
{{- end }}
99-
{{- with .service.labels }}
102+
{{- end }}
103+
{{- with .service.labels }}
100104
labels:
101105
{{- toYaml . | nindent 8 }}
102-
{{- end }}
106+
{{- end }}
103107
type: {{ .service.type }}
108+
{{- if eq .service.type "ClusterIP" }}
109+
{{- if .service.clusterIP }}
110+
clusterIP: {{ .service.clusterIP }}
111+
{{- end }}
112+
{{- end }}
104113
{{- end }}
105114
{{- with .client }}
106115
client:
@@ -110,8 +119,8 @@ items:
110119
compat:
111120
{{- toYaml . | nindent 6 }}
112121
{{- end }}
113-
{{- if or .serviceAccount.annotations .serviceAccount.labels }}
114122
serviceAccount:
123+
skip: {{ .serviceAccount.skip }}
115124
{{- with .serviceAccount.annotations }}
116125
annotations:
117126
{{- toYaml . | nindent 8 }}
@@ -124,7 +133,6 @@ items:
124133
imagePullSecrets:
125134
{{- toYaml . | nindent 8 }}
126135
{{- end }}
127-
{{- end }}
128136
config:
129137
{{- if .configTemplated }}
130138
{{- tpl (toYaml .config) $ | nindent 6 }}
@@ -189,5 +197,13 @@ items:
189197
jsonnet:
190198
{{- toYaml . | nindent 6 }}
191199
{{- end }}
200+
{{- with .livenessProbeSpec }}
201+
livenessProbeSpec:
202+
{{- toYaml . | nindent 6 }}
203+
{{- end }}
204+
{{- with .readinessProbeSpec }}
205+
readinessProbeSpec:
206+
{{- toYaml . | nindent 6 }}
207+
{{- end }}
192208
{{- end }}
193209
{{- end }}

templates/grafanaDashboard.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ items:
1010
labels:
1111
{{- include "grafana-operator.labels" $ | nindent 6 }}
1212
spec:
13-
name: {{ .name }}.json
1413
{{- if .json }}
1514
json:
1615
{{- if .jsonTemplated }}

values.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ operator:
99
##
1010
image:
1111
repository: quay.io/integreatly/grafana-operator
12-
tag: v3.6.0
12+
tag: v3.9.0
1313
pullPolicy: IfNotPresent
1414

1515
## Operator flags that can be passed in the args section of the container in the deployment
@@ -120,6 +120,11 @@ grafana:
120120
##
121121
baseImage: ""
122122

123+
## Custom grafana plugins init image for the grafana deployment
124+
## Warning! This overwrites the --grafana-plugins-init-container-image operator flag in .Values.operator.args.
125+
##
126+
initImage: ""
127+
123128
## Additional containers to add to the grafana pod
124129
##
125130
containers: []
@@ -176,6 +181,7 @@ grafana:
176181
##
177182
service:
178183
enabled: true
184+
name: grafana-service
179185
ports:
180186
- name: grafana
181187
port: 3000
@@ -184,6 +190,7 @@ grafana:
184190
annotations: {}
185191
labels: {}
186192
type: ClusterIP
193+
clusterIP: ""
187194

188195
## Grafana client settings
189196
##
@@ -196,6 +203,7 @@ grafana:
196203
compat: {}
197204

198205
serviceAccount:
206+
skip: false
199207
annotations: {}
200208
labels: {}
201209
imagePullSecrets: []
@@ -273,6 +281,16 @@ grafana:
273281
##
274282
jsonnet: {}
275283

284+
## Defines the time, in seconds, to be used for each field in the liveness probe configuration
285+
## ref: https://github.com/integr8ly/grafana-operator/blob/master/documentation/deploy_grafana.md#configuring-readinessliveness-probes
286+
##
287+
livenessProbeSpec: {}
288+
289+
## Defines the time, in seconds, to be used for each field in the readiness probe configuration
290+
## ref: https://github.com/integr8ly/grafana-operator/blob/master/documentation/deploy_grafana.md#configuring-readinessliveness-probes
291+
##
292+
readinessProbeSpec: {}
293+
276294
## Create GrafanaDataSource objects
277295
## ref: https://github.com/integr8ly/grafana-operator#grafanadatasource
278296
## ref: https://grafana.com/docs/grafana/latest/administration/provisioning/

0 commit comments

Comments
 (0)