Skip to content

Commit

Permalink
[FEATURE] helm: Monitoring options added
Browse files Browse the repository at this point in the history
Enable optional monitoring based on metrics implementation for controller & server.

Bump up version before release.
  • Loading branch information
Pavan-SAP committed Nov 11, 2024
1 parent d0dea78 commit 8419eb0
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 3 deletions.
4 changes: 2 additions & 2 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
description: Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
name: cap-operator
version: 0.10.2
appVersion: 0.10.0
version: 0.11.0
appVersion: 0.11.0
4 changes: 3 additions & 1 deletion chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cap-operator

![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)
![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)

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

Expand All @@ -19,6 +19,8 @@ Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
| topologySpreadConstraints | list | `[]` | Default topology spread constraints (can be overwritten on component level) |
| podLabels | object | `{}` | Additional pod labels for all components |
| podAnnotations | object | `{}` | Additional pod annotations for all components |
| monitoring | object | `{"enabled":false}` | Monitoring configuration for all components |
| monitoring.enabled | bool | `false` | Optionally enable Prometheus monitoring for all components (disabled by default) |
| controller.replicas | int | `1` | Replicas |
| controller.image.repository | string | `"ghcr.io/sap/cap-operator/controller"` | Image repository |
| controller.image.tag | string | `""` | Image tag |
Expand Down
41 changes: 41 additions & 0 deletions chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,45 @@ spec:
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: metrics-port
containerPort: 9090
protocol: TCP
serviceAccountName: {{.Release.Name}}-controller
---
kind: Service
apiVersion: v1
metadata:
name: {{.Release.Name}}-controller
labels:
operator.sme.sap.com/app: controller
operator.sme.sap.com/category: controller
operator.sme.sap.com/release: {{.Release.Name}}
spec:
ports:
- name: metrics-http
protocol: TCP
port: 9090
targetPort: metrics-port
selector:
operator.sme.sap.com/app: subscription-server
operator.sme.sap.com/category: controller
operator.sme.sap.com/release: {{.Release.Name}}
---
{{- if .Values.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{.Release.Name}}-controller
labels:
operator.sme.sap.com/app: controller
operator.sme.sap.com/category: controller
operator.sme.sap.com/release: {{.Release.Name}}
spec:
selector:
matchLabels:
operator.sme.sap.com/app: controller
operator.sme.sap.com/category: controller
endpoints:
- port: metrics-http
{{- end }}
25 changes: 25 additions & 0 deletions chart/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ spec:
- name: server-port
containerPort: 4000
protocol: TCP
- name: metrics-port
containerPort: 9090
protocol: TCP
serviceAccountName: {{.Release.Name}}-subscription-server
---
kind: Service
Expand All @@ -93,7 +96,29 @@ spec:
protocol: TCP
port: {{.Values.subscriptionServer.port}}
targetPort: server-port
- name: metrics-http
protocol: TCP
port: 9090
targetPort: metrics-port
selector:
operator.sme.sap.com/app: subscription-server
operator.sme.sap.com/category: controller
operator.sme.sap.com/release: {{.Release.Name}}
---
{{- if .Values.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{.Release.Name}}-subscription-server
labels:
operator.sme.sap.com/app: subscription-server
operator.sme.sap.com/category: controller
operator.sme.sap.com/release: {{.Release.Name}}
spec:
selector:
matchLabels:
operator.sme.sap.com/app: subscription-server
operator.sme.sap.com/category: controller
endpoints:
- port: metrics-http
{{- end }}
4 changes: 4 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ topologySpreadConstraints: []
podLabels: {}
# -- Additional pod annotations for all components
podAnnotations: {}
# -- Monitoring configuration for all components
monitoring:
# -- Optionally enable Prometheus monitoring for all components (disabled by default)
enabled: false

controller:
# -- Replicas
Expand Down

0 comments on commit 8419eb0

Please sign in to comment.