Skip to content

Commit 3b91d97

Browse files
authored
Update helm values file to move controller.serviceMonitor to prometheus.serviceMonitor (#4351)
1 parent 372aeb9 commit 3b91d97

File tree

4 files changed

+79
-68
lines changed

4 files changed

+79
-68
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
{{- if .Values.controller.serviceMonitor.create }}
1+
{{- if .Values.prometheus.serviceMonitor.create }}
22
apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
55
name: {{ include "nginx-ingress.controller.fullname" . }}
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "nginx-ingress.labels" . | nindent 4 }}
9-
{{- if .Values.controller.serviceMonitor.labels -}}
10-
{{- toYaml .Values.controller.serviceMonitor.labels | nindent 4 }}
9+
{{- if .Values.prometheus.serviceMonitor.labels -}}
10+
{{- toYaml .Values.prometheus.serviceMonitor.labels | nindent 4 }}
1111
{{- end }}
1212
spec:
1313
selector:
1414
matchLabels:
15-
{{- if .Values.controller.serviceMonitor.selectorMatchLabels -}}
16-
{{- toYaml .Values.controller.serviceMonitor.selectorMatchLabels | nindent 6 }}
15+
{{- if .Values.prometheus.serviceMonitor.selectorMatchLabels -}}
16+
{{- toYaml .Values.prometheus.serviceMonitor.selectorMatchLabels | nindent 6 }}
1717
{{- end }}
1818
{{- include "nginx-ingress.selectorLabels" . | nindent 6 }}
1919
endpoints:
20-
{{- toYaml .Values.controller.serviceMonitor.endpoints | nindent 4 }}
20+
{{- toYaml .Values.prometheus.serviceMonitor.endpoints | nindent 4 }}
2121
{{- end }}

deployments/helm-chart/values.schema.json

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,49 +1061,6 @@
10611061
}
10621062
]
10631063
},
1064-
"serviceMonitor": {
1065-
"type": "object",
1066-
"default": {},
1067-
"title": "The serviceMonitor Schema",
1068-
"required": [],
1069-
"properties": {
1070-
"create": {
1071-
"type": "boolean",
1072-
"default": false,
1073-
"title": "The create",
1074-
"examples": [
1075-
false
1076-
]
1077-
},
1078-
"labels": {
1079-
"type": "object",
1080-
"default": {},
1081-
"title": "The labels Schema",
1082-
"$ref": "https://raw.githubusercontent.com/nginxinc/kubernetes-json-schema/master/v1.27.4/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels"
1083-
},
1084-
"selectorMatchLabels": {
1085-
"type": "object",
1086-
"default": {},
1087-
"title": "The selectorMatchLabels Schema",
1088-
"$ref": "https://raw.githubusercontent.com/nginxinc/kubernetes-json-schema/master/v1.27.4/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector/properties/matchLabels"
1089-
},
1090-
"endpoints": {
1091-
"type": "array",
1092-
"default": [],
1093-
"title": "The endpoints",
1094-
"required": [],
1095-
"items": {}
1096-
}
1097-
},
1098-
"examples": [
1099-
{
1100-
"create": false,
1101-
"labels": {},
1102-
"selectorMatchLabels": {},
1103-
"endpoints": []
1104-
}
1105-
]
1106-
},
11071064
"reportIngressStatus": {
11081065
"type": "object",
11091066
"default": {},
@@ -1524,6 +1481,49 @@
15241481
"$ref": "https://raw.githubusercontent.com/nginxinc/kubernetes-json-schema/master/v1.27.4/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels"
15251482
}
15261483
}
1484+
},
1485+
"serviceMonitor": {
1486+
"type": "object",
1487+
"default": {},
1488+
"title": "The serviceMonitor Schema",
1489+
"required": [],
1490+
"properties": {
1491+
"create": {
1492+
"type": "boolean",
1493+
"default": false,
1494+
"title": "The create",
1495+
"examples": [
1496+
false
1497+
]
1498+
},
1499+
"labels": {
1500+
"type": "object",
1501+
"default": {},
1502+
"title": "The labels Schema",
1503+
"$ref": "https://raw.githubusercontent.com/nginxinc/kubernetes-json-schema/master/v1.27.4/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels"
1504+
},
1505+
"selectorMatchLabels": {
1506+
"type": "object",
1507+
"default": {},
1508+
"title": "The selectorMatchLabels Schema",
1509+
"$ref": "https://raw.githubusercontent.com/nginxinc/kubernetes-json-schema/master/v1.27.4/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector/properties/matchLabels"
1510+
},
1511+
"endpoints": {
1512+
"type": "array",
1513+
"default": [],
1514+
"title": "The endpoints",
1515+
"required": [],
1516+
"items": {}
1517+
}
1518+
},
1519+
"examples": [
1520+
{
1521+
"create": false,
1522+
"labels": {},
1523+
"selectorMatchLabels": {},
1524+
"endpoints": []
1525+
}
1526+
]
15271527
}
15281528
},
15291529
"examples": [
@@ -1740,12 +1740,6 @@
17401740
"minAvailable": 0,
17411741
"minUnavailable": 0
17421742
},
1743-
"serviceMonitor": {
1744-
"create": false,
1745-
"labels": {},
1746-
"selectorMatchLabels": {},
1747-
"endpoints": {}
1748-
},
17491743
"reportIngressStatus": {
17501744
"enable": true,
17511745
"externalService": "",
@@ -1779,6 +1773,12 @@
17791773
"service": {
17801774
"create": false,
17811775
"labels": {}
1776+
},
1777+
"serviceMonitor": {
1778+
"create": false,
1779+
"labels": {},
1780+
"selectorMatchLabels": {},
1781+
"endpoints": {}
17821782
}
17831783
},
17841784
"serviceInsight": {

deployments/helm-chart/values.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -439,19 +439,6 @@ controller:
439439
## Configure root filesystem as read-only and add volumes for temporary data.
440440
readOnlyRootFilesystem: false
441441

442-
serviceMonitor:
443-
## Creates a serviceMonitor to expose statistics on the kubernetes pods.
444-
create: false
445-
446-
## Kubernetes object labels to attach to the serviceMonitor object.
447-
labels: {}
448-
449-
## A set of labels to allow the selection of endpoints for the ServiceMonitor.
450-
selectorMatchLabels: {}
451-
452-
## A list of endpoints allowed as part of this ServiceMonitor.
453-
endpoints: []
454-
455442
rbac:
456443
## Configures RBAC.
457444
create: true
@@ -474,8 +461,25 @@ prometheus:
474461
## Requires prometheus.create=true
475462
create: false
476463

464+
labels:
465+
service: "nginx-ingress-prometheus-service"
466+
467+
serviceMonitor:
468+
## Creates a serviceMonitor to expose statistics on the kubernetes pods.
469+
create: false
470+
471+
## Kubernetes object labels to attach to the serviceMonitor object.
477472
labels: {}
478473

474+
## A set of labels to allow the selection of endpoints for the ServiceMonitor.
475+
selectorMatchLabels:
476+
service: "nginx-ingress-prometheus-service"
477+
478+
## A list of endpoints allowed as part of this ServiceMonitor.
479+
## Matches on the name of a Service port.
480+
endpoints:
481+
- port: prometheus
482+
479483
serviceInsight:
480484
## Expose NGINX Plus Service Insight endpoint.
481485
create: false

docs/content/installation/installation-with-helm.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,13 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
411411
|`prometheus.port` | Configures the port to scrape the metrics. | 9113 |
412412
|`prometheus.scheme` | Configures the HTTP scheme to use for connections to the Prometheus endpoint. | http |
413413
|`prometheus.secret` | The namespace / name of a Kubernetes TLS Secret. If specified, this secret is used to secure the Prometheus endpoint with TLS connections. | "" |
414+
|`prometheus.service.create` | Create a Headless service to expose prometheus metrics. Requires `prometheus.create`. | false |
415+
|`prometheus.service.endpoint` | Configures the name of the service's port listing. | prometheus |
416+
|`prometheus.service.labels` | Kubernetes object labels to attach to the service object. | "" |
417+
|`prometheus.serviceMonitor.create` | Create a ServiceMonitor custom resource. Requires ServiceMonitor CRD to be installed. For the latest CRD, check the latest release on the [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator) GitHub repo under `example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml` | false |
418+
|`prometheus.serviceMonitor.labels` | Kubernetes object labels to attach to the serviceMonitor object. | "" |
419+
|`prometheus.serviceMonitor.selectorMatchLabels` | A set of labels to allow the selection of endpoints for the ServiceMonitor. | "" |
420+
|`prometheus.serviceMonitor.endpoints` | A list of endpoints allowed as part of this ServiceMonitor. | "" |
414421
|`serviceInsight.create` | Expose NGINX Plus Service Insight endpoint. | false |
415422
|`serviceInsight.port` | Configures the port to expose endpoints. | 9114 |
416423
|`serviceInsight.scheme` | Configures the HTTP scheme to use for connections to the Service Insight endpoint. | http |

0 commit comments

Comments
 (0)