-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(helm): Add ServiceMonitor (#695)
# Description Adding support for `ServiceMonitor`. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [x] I have updated the documentation, if necessary. ## Screenshots (if applicable) or Testing Completed ![image (2)](https://github.com/user-attachments/assets/f377b3b0-c41f-48ce-8e1f-0eef562ecd73) ![image (1)](https://github.com/user-attachments/assets/c11a6aa0-e897-43a3-b29c-2c2625554fb0)
- Loading branch information
Showing
3 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
deploy/legacy/manifests/controller/helm/retina/templates/podmonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
deploy/legacy/manifests/controller/helm/retina/templates/servicemonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{- if and (not .Values.metrics.podMonitor.enabled) .Values.metrics.serviceMonitor.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ include "retina.fullname" . }} | ||
namespace: {{ ternary .Values.metrics.serviceMonitor.namespace .Values.namespace (not (empty .Values.metrics.serviceMonitor.namespace)) }} | ||
labels: | ||
k8s-app: {{ include "retina.name" . }} | ||
{{- include "retina.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: metrics | ||
{{- if .Values.metrics.serviceMonitor.additionalLabels }} | ||
{{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- targetPort: retina | ||
path: /metrics | ||
{{- if .Values.metrics.serviceMonitor.interval }} | ||
interval: {{ .Values.metrics.serviceMonitor.interval }} | ||
{{- end }} | ||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} | ||
{{- end }} | ||
{{- if .Values.metrics.serviceMonitor.scheme }} | ||
scheme: {{ .Values.metrics.serviceMonitor.scheme }} | ||
{{- end }} | ||
{{- if .Values.metrics.serviceMonitor.tlsConfig }} | ||
tlsConfig: {{- .Values.metrics.serviceMonitor.tlsConfig | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.metrics.serviceMonitor.relabelings }} | ||
relabelings: | ||
{{- toYaml .Values.metrics.serviceMonitor.relabelings | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.metrics.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: | ||
{{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 8 }} | ||
{{- end }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Values.namespace }} | ||
selector: | ||
matchLabels: | ||
{{- include "retina.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: networking | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters