Skip to content

Commit 2e74dc3

Browse files
committed
[FEATURE] helm: Monitoring options added
Enable optional monitoring based on metrics implementation for operator- controller & server. Controller: - Provide configuration for enabling detailed operational metrics. Release: Bump up version before release.
1 parent d0dea78 commit 2e74dc3

File tree

5 files changed

+80
-3
lines changed

5 files changed

+80
-3
lines changed

chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
22
description: Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
33
name: cap-operator
4-
version: 0.10.2
5-
appVersion: 0.10.0
4+
version: 0.11.0
5+
appVersion: 0.11.0

chart/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cap-operator
22

3-
![Version: 0.10.1](https://img.shields.io/badge/Version-0.10.1-informational?style=flat-square) ![AppVersion: 0.10.0](https://img.shields.io/badge/AppVersion-0.10.0-informational?style=flat-square)
3+
![Version: 0.11.0](https://img.shields.io/badge/Version-0.11.0-informational?style=flat-square) ![AppVersion: 0.11.0](https://img.shields.io/badge/AppVersion-0.11.0-informational?style=flat-square)
44

55
Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
66

@@ -19,6 +19,8 @@ Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
1919
| topologySpreadConstraints | list | `[]` | Default topology spread constraints (can be overwritten on component level) |
2020
| podLabels | object | `{}` | Additional pod labels for all components |
2121
| podAnnotations | object | `{}` | Additional pod annotations for all components |
22+
| monitoring | object | `{"enabled":false}` | Monitoring configuration for all components |
23+
| monitoring.enabled | bool | `false` | Optionally enable Prometheus monitoring for all components (disabled by default) |
2224
| controller.replicas | int | `1` | Replicas |
2325
| controller.image.repository | string | `"ghcr.io/sap/cap-operator/controller"` | Image repository |
2426
| controller.image.tag | string | `""` | Image tag |
@@ -40,6 +42,7 @@ Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
4042
| controller.volumes | list | `[]` | Optionally specify list of additional volumes for the controller pod(s) |
4143
| controller.volumeMounts | list | `[]` | Optionally specify list of additional volumeMounts for the controller container(s) |
4244
| controller.dnsTarget | string | `""` | The dns target mentioned on the public ingress gateway service used in the cluster |
45+
| controller.detailedOperationalMetrics | bool | `false` | Optionally enable detailed opertational metrics for the controller by setting this to true |
4346
| controller.versionMonitoring.prometheusAddress | string | `""` | The URL of the Prometheus server from which metrics related to managed application versions can be queried |
4447
| controller.versionMonitoring.metricsEvaluationInterval | string | `"1h"` | The duration (example 2h) after which versions are evaluated for deletion; based on specified workload metrics |
4548
| controller.versionMonitoring.promClientAcquireRetryDelay | string | `"1h"` | The duration (example 10m) to wait before retrying to acquire Prometheus client and verify connection, after a failed attempt |

chart/templates/controller-deployment.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ spec:
6969
resources:
7070
{{- toYaml .Values.controller.resources | nindent 12 }}
7171
env:
72+
- name: DETAILED_OPERATIONAL_METRICS
73+
value: "{{ .Values.controller.detailedOperationalMetrics }}"
7274
- name: CERT_MANAGER
7375
value: {{ .Capabilities.APIVersions.Has "cert.gardener.cloud/v1alpha1" | ternary "gardener" "cert-manager.io" }}
7476
- name: DNS_MANAGER
@@ -95,4 +97,45 @@ spec:
9597
volumeMounts:
9698
{{- toYaml . | nindent 12 }}
9799
{{- end }}
100+
ports:
101+
- name: metrics-port
102+
containerPort: 9090
103+
protocol: TCP
98104
serviceAccountName: {{.Release.Name}}-controller
105+
---
106+
kind: Service
107+
apiVersion: v1
108+
metadata:
109+
name: {{.Release.Name}}-controller
110+
labels:
111+
operator.sme.sap.com/app: controller
112+
operator.sme.sap.com/category: controller
113+
operator.sme.sap.com/release: {{.Release.Name}}
114+
spec:
115+
ports:
116+
- name: metrics-http
117+
protocol: TCP
118+
port: 9090
119+
targetPort: metrics-port
120+
selector:
121+
operator.sme.sap.com/app: controller
122+
operator.sme.sap.com/category: controller
123+
operator.sme.sap.com/release: {{.Release.Name}}
124+
---
125+
{{- if .Values.monitoring.enabled }}
126+
apiVersion: monitoring.coreos.com/v1
127+
kind: ServiceMonitor
128+
metadata:
129+
name: {{.Release.Name}}-controller
130+
labels:
131+
operator.sme.sap.com/app: controller
132+
operator.sme.sap.com/category: controller
133+
operator.sme.sap.com/release: {{.Release.Name}}
134+
spec:
135+
selector:
136+
matchLabels:
137+
operator.sme.sap.com/app: controller
138+
operator.sme.sap.com/category: controller
139+
endpoints:
140+
- port: metrics-http
141+
{{- end }}

chart/templates/server-deployment.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ spec:
7777
- name: server-port
7878
containerPort: 4000
7979
protocol: TCP
80+
- name: metrics-port
81+
containerPort: 9090
82+
protocol: TCP
8083
serviceAccountName: {{.Release.Name}}-subscription-server
8184
---
8285
kind: Service
@@ -93,7 +96,29 @@ spec:
9396
protocol: TCP
9497
port: {{.Values.subscriptionServer.port}}
9598
targetPort: server-port
99+
- name: metrics-http
100+
protocol: TCP
101+
port: 9090
102+
targetPort: metrics-port
96103
selector:
97104
operator.sme.sap.com/app: subscription-server
98105
operator.sme.sap.com/category: controller
99106
operator.sme.sap.com/release: {{.Release.Name}}
107+
---
108+
{{- if .Values.monitoring.enabled }}
109+
apiVersion: monitoring.coreos.com/v1
110+
kind: ServiceMonitor
111+
metadata:
112+
name: {{.Release.Name}}-subscription-server
113+
labels:
114+
operator.sme.sap.com/app: subscription-server
115+
operator.sme.sap.com/category: controller
116+
operator.sme.sap.com/release: {{.Release.Name}}
117+
spec:
118+
selector:
119+
matchLabels:
120+
operator.sme.sap.com/app: subscription-server
121+
operator.sme.sap.com/category: controller
122+
endpoints:
123+
- port: metrics-http
124+
{{- end }}

chart/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ topologySpreadConstraints: []
2121
podLabels: {}
2222
# -- Additional pod annotations for all components
2323
podAnnotations: {}
24+
# -- Monitoring configuration for all components
25+
monitoring:
26+
# -- Optionally enable Prometheus monitoring for all components (disabled by default)
27+
enabled: false
2428

2529
controller:
2630
# -- Replicas
@@ -69,6 +73,8 @@ controller:
6973
volumeMounts: []
7074
# -- The dns target mentioned on the public ingress gateway service used in the cluster
7175
dnsTarget: ""
76+
# -- Optionally enable detailed opertational metrics for the controller by setting this to true
77+
detailedOperationalMetrics: false
7278
versionMonitoring:
7379
# -- The URL of the Prometheus server from which metrics related to managed application versions can be queried
7480
prometheusAddress: ""

0 commit comments

Comments
 (0)