Skip to content

Commit

Permalink
Added support for tlsConfig for ServiceMonitor (#353)
Browse files Browse the repository at this point in the history
* Added support for tlsConfig for ServiceMonitor

- Added tlsConfig within the ServiceMonitor stanza.
- Extended servicemonitor.yaml template to include tlsConfig if defined.

* Added the new tlsConfig documentation to the README.md template
  • Loading branch information
mprimeaux authored Oct 5, 2023
1 parent 573268c commit 0c8bb79
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ For details see the [`values.yaml`](values.yaml) file.
| `serviceMonitor.annotations` | Additional annotations of ServiceMonitor | `{}` |
| `serviceMonitor.interval` | ServiceMonitor scrape metrics interval | `10s` |
| `serviceMonitor.scrapeTimeout` | ServiceMonitor scrape timeout | `nil` |
| `serviceMonitor.tlsConfig` | Additional TLS configuration of ServiceMonitor | `{}` |
| `serviceMonitor.namespaced` | Limit ServiceMonitor to current namespace | `false` |
| `storage.hostPath` | Absolute path on host to store data | `""` |
| `storage.persistentVolume.enabled` | Whether to use PersistentVolume to store data | `yes` |
Expand Down
4 changes: 4 additions & 0 deletions build/templates/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ serviceMonitor:
# Limits the ServiceMonitor to the current namespace if set to `true`.
namespaced: false

# tlsConfig: TLS configuration to use when scraping the endpoint.
# Of type: https://github.com/coreos/prometheus-operator/blob/main/Documentation/api.md#tlsconfig
tlsConfig: {}

# CockroachDB's data persistence.
# If neither `persistentVolume` nor `hostPath` is used, then data will be
# persisted in ad-hoc `emptyDir`.
Expand Down
1 change: 1 addition & 0 deletions cockroachdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ For details see the [`values.yaml`](values.yaml) file.
| `serviceMonitor.annotations` | Additional annotations of ServiceMonitor | `{}` |
| `serviceMonitor.interval` | ServiceMonitor scrape metrics interval | `10s` |
| `serviceMonitor.scrapeTimeout` | ServiceMonitor scrape timeout | `nil` |
| `serviceMonitor.tlsConfig` | Additional TLS configuration of ServiceMonitor | `{}` |
| `serviceMonitor.namespaced` | Limit ServiceMonitor to current namespace | `false` |
| `storage.hostPath` | Absolute path on host to store data | `""` |
| `storage.persistentVolume.enabled` | Whether to use PersistentVolume to store data | `yes` |
Expand Down
3 changes: 3 additions & 0 deletions cockroachdb/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ spec:
{{- if $serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ $serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.serviceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.serviceMonitor.tlsConfig | nindent 6 }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions cockroachdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ serviceMonitor:
# Limits the ServiceMonitor to the current namespace if set to `true`.
namespaced: false

# tlsConfig: TLS configuration to use when scraping the endpoint.
# Of type: https://github.com/coreos/prometheus-operator/blob/main/Documentation/api.md#tlsconfig
tlsConfig: {}

# CockroachDB's data persistence.
# If neither `persistentVolume` nor `hostPath` is used, then data will be
# persisted in ad-hoc `emptyDir`.
Expand Down

0 comments on commit 0c8bb79

Please sign in to comment.