From 5ef46810553f3dec901a0d413fb468e54817637e Mon Sep 17 00:00:00 2001 From: Jorge Turrado Date: Thu, 18 Jan 2024 21:40:31 +0100 Subject: [PATCH] Add tlsConfig for ServiceMonitor Co-authored-by: guicholeo Signed-off-by: Jorge Turrado --- keda/README.md | 6 +++++ keda/templates/manager/servicemonitor.yaml | 5 ++++ .../metrics-server/servicemonitor.yaml | 5 ++++ keda/templates/webhooks/servicemonitor.yaml | 5 ++++ keda/values.yaml | 24 +++++++++++++++++++ 5 files changed, 45 insertions(+) diff --git a/keda/README.md b/keda/README.md index c0de0233..f3e0a0a8 100644 --- a/keda/README.md +++ b/keda/README.md @@ -195,9 +195,11 @@ their default values. | `prometheus.metricServer.serviceMonitor.port` | string | `"metrics"` | Name of the service port this endpoint refers to. Mutually exclusive with targetPort | | `prometheus.metricServer.serviceMonitor.relabelings` | list | `[]` | List of expressions that define custom relabeling rules for metric server ServiceMonitor crd (prometheus operator). [RelabelConfig Spec] | | `prometheus.metricServer.serviceMonitor.relabellings` | list | `[]` | DEPRECATED. List of expressions that define custom relabeling rules for metric server ServiceMonitor crd (prometheus operator). [RelabelConfig Spec] | +| `prometheus.metricServer.serviceMonitor.scheme` | string | `"http"` | HTTP scheme used for scraping. Defaults to `http` | | `prometheus.metricServer.serviceMonitor.scrapeTimeout` | string | `""` | Timeout after which the scrape is ended If not specified, the Prometheus global scrape timeout is used unless it is less than Interval in which the latter is used | | `prometheus.metricServer.serviceMonitor.targetLabels` | list | `[]` | TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics | | `prometheus.metricServer.serviceMonitor.targetPort` | string | `""` | Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port | +| `prometheus.metricServer.serviceMonitor.tlsConfig` | object | `{}` | TLS configuration for scraping metrics | | `prometheus.operator.enabled` | bool | `false` | Enable KEDA Operator prometheus metrics expose | | `prometheus.operator.podMonitor.additionalLabels` | object | `{}` | Additional labels to add for KEDA Operator using podMonitor crd (prometheus operator) | | `prometheus.operator.podMonitor.enabled` | bool | `false` | Enables PodMonitor creation for the Prometheus Operator | @@ -218,9 +220,11 @@ their default values. | `prometheus.operator.serviceMonitor.port` | string | `"metrics"` | Name of the service port this endpoint refers to. Mutually exclusive with targetPort | | `prometheus.operator.serviceMonitor.relabelings` | list | `[]` | List of expressions that define custom relabeling rules for metric server ServiceMonitor crd (prometheus operator). [RelabelConfig Spec] | | `prometheus.operator.serviceMonitor.relabellings` | list | `[]` | DEPRECATED. List of expressions that define custom relabeling rules for metric server ServiceMonitor crd (prometheus operator). [RelabelConfig Spec] | +| `prometheus.operator.serviceMonitor.scheme` | string | `"http"` | HTTP scheme used for scraping. Defaults to `http` | | `prometheus.operator.serviceMonitor.scrapeTimeout` | string | `""` | Timeout after which the scrape is ended If not specified, the Prometheus global scrape timeout is used unless it is less than Interval in which the latter is used | | `prometheus.operator.serviceMonitor.targetLabels` | list | `[]` | TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics | | `prometheus.operator.serviceMonitor.targetPort` | string | `""` | Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port | +| `prometheus.operator.serviceMonitor.tlsConfig` | object | `{}` | TLS configuration for scraping metrics | | `prometheus.webhooks.enabled` | bool | `false` | Enable KEDA admission webhooks prometheus metrics expose | | `prometheus.webhooks.port` | int | `8080` | Port used for exposing KEDA admission webhooks prometheus metrics | | `prometheus.webhooks.prometheusRules.additionalLabels` | object | `{}` | Additional labels to add for KEDA admission webhooks using prometheusRules crd (prometheus operator) | @@ -235,9 +239,11 @@ their default values. | `prometheus.webhooks.serviceMonitor.port` | string | `"metrics"` | Name of the service port this endpoint refers to. Mutually exclusive with targetPort | | `prometheus.webhooks.serviceMonitor.relabelings` | list | `[]` | List of expressions that define custom relabeling rules for metric server ServiceMonitor crd (prometheus operator). [RelabelConfig Spec] | | `prometheus.webhooks.serviceMonitor.relabellings` | list | `[]` | DEPRECATED. List of expressions that define custom relabeling rules for metric server ServiceMonitor crd (prometheus operator). [RelabelConfig Spec] | +| `prometheus.webhooks.serviceMonitor.scheme` | string | `"http"` | HTTP scheme used for scraping. Defaults to `http` | | `prometheus.webhooks.serviceMonitor.scrapeTimeout` | string | `""` | Timeout after which the scrape is ended If not specified, the Prometheus global scrape timeout is used unless it is less than Interval in which the latter is used | | `prometheus.webhooks.serviceMonitor.targetLabels` | list | `[]` | TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics | | `prometheus.webhooks.serviceMonitor.targetPort` | string | `""` | Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port | +| `prometheus.webhooks.serviceMonitor.tlsConfig` | object | `{}` | TLS configuration for scraping metrics | ### Troubleshooting diff --git a/keda/templates/manager/servicemonitor.yaml b/keda/templates/manager/servicemonitor.yaml index 727601cb..1213ee59 100644 --- a/keda/templates/manager/servicemonitor.yaml +++ b/keda/templates/manager/servicemonitor.yaml @@ -51,6 +51,11 @@ spec: {{- toYaml . | nindent 6 }} {{- end }} {{- end}} + scheme: {{ .Values.prometheus.operator.serviceMonitor.scheme }} + {{- with .Values.prometheus.operator.serviceMonitor.tlsConfig }} + tlsConfig: + {{ toYaml . | nindent 6}} + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/keda/templates/metrics-server/servicemonitor.yaml b/keda/templates/metrics-server/servicemonitor.yaml index a2a0dfc7..4e4fb12b 100644 --- a/keda/templates/metrics-server/servicemonitor.yaml +++ b/keda/templates/metrics-server/servicemonitor.yaml @@ -51,6 +51,11 @@ spec: {{- toYaml . | nindent 6 }} {{- end }} {{- end}} + scheme: {{ .Values.prometheus.metricServer.serviceMonitor.scheme }} + {{- with .Values.prometheus.metricServer.serviceMonitor.tlsConfig }} + tlsConfig: + {{ toYaml . | nindent 6}} + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/keda/templates/webhooks/servicemonitor.yaml b/keda/templates/webhooks/servicemonitor.yaml index 48b5223d..8452b4d0 100644 --- a/keda/templates/webhooks/servicemonitor.yaml +++ b/keda/templates/webhooks/servicemonitor.yaml @@ -52,6 +52,11 @@ spec: {{- toYaml . | nindent 6 }} {{- end }} {{- end}} + scheme: {{ .Values.prometheus.webhooks.serviceMonitor.scheme }} + {{- with .Values.prometheus.webhooks.serviceMonitor.tlsConfig }} + tlsConfig: + {{ toYaml . | nindent 6}} + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/keda/values.yaml b/keda/values.yaml index f64216de..ee21e107 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -570,6 +570,14 @@ prometheus: relabelings: [] # -- Additional labels to add for metric server using ServiceMonitor crd (prometheus operator) additionalLabels: {} + # -- HTTP scheme used for scraping. Defaults to `http` + scheme: http + # -- TLS configuration for scraping metrics + tlsConfig: {} + # caFile: /etc/prom-certs/root-cert.pem + # certFile: /etc/prom-certs/cert-chain.pem + # insecureSkipVerify: true + # keyFile: /etc/prom-certs/key.pem podMonitor: # -- Enables PodMonitor creation for the Prometheus Operator enabled: false @@ -612,6 +620,14 @@ prometheus: relabelings: [] # -- Additional labels to add for metric server using ServiceMonitor crd (prometheus operator) additionalLabels: {} + # -- HTTP scheme used for scraping. Defaults to `http` + scheme: http + # -- TLS configuration for scraping metrics + tlsConfig: {} + # caFile: /etc/prom-certs/root-cert.pem + # certFile: /etc/prom-certs/cert-chain.pem + # insecureSkipVerify: true + # keyFile: /etc/prom-certs/key.pem podMonitor: # -- Enables PodMonitor creation for the Prometheus Operator enabled: false @@ -670,6 +686,14 @@ prometheus: relabelings: [] # -- Additional labels to add for metric server using ServiceMonitor crd (prometheus operator) additionalLabels: {} + # -- HTTP scheme used for scraping. Defaults to `http` + scheme: http + # -- TLS configuration for scraping metrics + tlsConfig: {} + # caFile: /etc/prom-certs/root-cert.pem + # certFile: /etc/prom-certs/cert-chain.pem + # insecureSkipVerify: true + # keyFile: /etc/prom-certs/key.pem prometheusRules: # -- Enables PrometheusRules creation for the Prometheus Operator enabled: false