Skip to content

Commit

Permalink
Add tlsConfig for ServiceMonitor (#591)
Browse files Browse the repository at this point in the history
Co-authored-by: guicholeo <[email protected]>
  • Loading branch information
JorTurFer and guicholeo authored Jan 19, 2024
1 parent 891ce78 commit ec0e32e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,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 |
Expand All @@ -220,9 +222,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) |
Expand All @@ -237,9 +241,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

Expand Down
5 changes: 5 additions & 0 deletions keda/templates/manager/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 5 additions & 0 deletions keda/templates/metrics-server/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 5 additions & 0 deletions keda/templates/webhooks/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
24 changes: 24 additions & 0 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,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
Expand Down Expand Up @@ -618,6 +626,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
Expand Down Expand Up @@ -676,6 +692,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
Expand Down

0 comments on commit ec0e32e

Please sign in to comment.