Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tlsConfig & namespaceSelector for metrics serviceMonitor #749

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion chart/templates/prometheus-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ spec:
selector:
matchLabels:
control-plane: controller-manager
{{- if .Values.telemetry.serviceMonitor.namespaceSelector }}
namespaceSelector:
matchNames:
{{- toYaml .Values.telemetry.serviceMonitor.namespaceSelector | nindent 6 }}
{{- end }}
endpoints:
- port: {{ .Values.telemetry.serviceMonitor.port }}
scheme: {{ .Values.telemetry.serviceMonitor.scheme }}
Expand All @@ -34,5 +39,10 @@ spec:
format:
- prometheus
tlsConfig:
insecureSkipVerify: true
insecureSkipVerify: {{ .Values.telemetry.serviceMonitor.insecureSkipVerify }}
{{- if .Values.telemetry.serviceMonitor.tlsconfiguration.enabled }}
caFile: {{ .Values.telemetry.serviceMonitor.tlsconfiguration.caFile }}
certFile: {{ .Values.telemetry.serviceMonitor.tlsconfiguration.certFile }}
keyFile: {{ .Values.telemetry.serviceMonitor.tlsconfiguration.keyFile }}
{{- end }}
{{ end }}
2 changes: 1 addition & 1 deletion chart/templates/tests/test-runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ metadata:
spec:
containers:
- name: vault-operator-test
image: "{{ .Values.controller.manager.image.repository }}"
image: "{{ .Values.controller.manager.image.repository.tag }}"
{{- end }}
21 changes: 20 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,14 @@ telemetry:

# Selector labels to add to the ServiceMonitor.
# When empty, defaults to:
# release: prometheus
# control-plane: controller-manager
# @type: string
selectors: {}

# NamespaceSelector labels to add Vault Secrets Operator metric's service namespace
# When empty , defaults to your Vault Secrets Operator's release namespace
namespaceSelector: {}

# Scheme of the service Prometheus scrapes metrics from. This must match the scheme of the metrics service of VSO
# @type: string
scheme: https
Expand All @@ -744,6 +748,21 @@ telemetry:
# @type: string
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token

# tlsConfig for serviceMonitor.
# true means skip the verification of SSL/TLS certificates when establishing a secure connection to the target endpoints
insecureSkipVerify: true

# Enable tlsconfiguration to provide CA certificates, client certificates, and client keys for SSL/TLS certificates validation
# @type: boolean
tlsconfiguration:
enabled: false

# Uncomment following to add configuration
# @type: string
# caFile: /path/to/ca.crt
# certFile: /path/to/client.crt
# keyFile: /path/to/client.key

# Interval at which Prometheus scrapes metrics
# @type: string
interval: 30s
Expand Down