File tree 5 files changed +26
-2
lines changed
5 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command docum
81
81
| controller.podSecurityContext | object | ` {"runAsNonRoot":true,"seccompProfile":{"type":"RuntimeDefault"}} ` | Security context of the jobset controller pods. |
82
82
| certManager.enable | bool | ` false ` | Whether to use cert-manager to generate certificates for the jobset webhook. |
83
83
| certManager.issuerRef | object | ` {} ` | The reference to the issuer. If empty, self-signed issuer will be created and used. |
84
- | prometheus.enable | bool | ` true ` | Whether to enable Prometheus metrics exporting. |
84
+ | prometheus.enable | bool | ` false ` | Whether to enable Prometheus metrics exporting. |
85
85
86
86
## Maintainers
87
87
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ limitations under the License.
15
15
*/ -}}
16
16
17
17
{{- if .Values.prometheus.enable }}
18
+ {{- if not (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
19
+ {{- fail "The cluster does not support the required API resource `monitoring.coreos.com/v1/ServiceMonitor`." }}
20
+ {{- end -}}
18
21
apiVersion : monitoring.coreos.com/v1
19
22
kind : ServiceMonitor
20
23
metadata :
Original file line number Diff line number Diff line change @@ -24,7 +24,15 @@ release:
24
24
namespace : jobset-system
25
25
26
26
tests :
27
+ - it : Should not create Prometheus ServiceMonitor by default
28
+ asserts :
29
+ - hasDocuments :
30
+ count : 0
31
+
27
32
- it : Should create Prometheus ServiceMonitor if `prometheus.enable` is `true`
33
+ capabilities :
34
+ apiVersions :
35
+ - monitoring.coreos.com/v1/ServiceMonitor
28
36
set :
29
37
prometheus :
30
38
enable : true
@@ -33,3 +41,11 @@ tests:
33
41
apiVersion : monitoring.coreos.com/v1
34
42
kind : ServiceMonitor
35
43
name : jobset-metrics-service-monitor
44
+
45
+ - it : Should fail if the cluster does not support the required API resource `monitoring.coreos.com/v1/ServiceMonitor`
46
+ set :
47
+ prometheus :
48
+ enable : true
49
+ asserts :
50
+ - failedTemplate :
51
+ errorMessage : " The cluster does not support the required API resource `monitoring.coreos.com/v1/ServiceMonitor`."
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ release:
24
24
namespace : jobset-system
25
25
26
26
tests :
27
+ - it : Should not create Prometheus metrics service by default
28
+ asserts :
29
+ - hasDocuments :
30
+ count : 0
31
+
27
32
- it : Should create Prometheus Service if `prometheus.enable` is `true`
28
33
set :
29
34
prometheus :
Original file line number Diff line number Diff line change @@ -107,4 +107,4 @@ certManager:
107
107
108
108
prometheus :
109
109
# -- Whether to enable Prometheus metrics exporting.
110
- enable : true
110
+ enable : false
You can’t perform that action at this time.
0 commit comments