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

[FEATURE] helm: Monitoring options added #95

Merged
merged 1 commit into from
Nov 13, 2024
Merged
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
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
5 changes: 4 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 All @@ -40,6 +42,7 @@ Helm chart to deploy CAP Operator https://sap.github.io/cap-operator/
| controller.volumes | list | `[]` | Optionally specify list of additional volumes for the controller pod(s) |
| controller.volumeMounts | list | `[]` | Optionally specify list of additional volumeMounts for the controller container(s) |
| controller.dnsTarget | string | `""` | The dns target mentioned on the public ingress gateway service used in the cluster |
| controller.detailedOperationalMetrics | bool | `false` | Optionally enable detailed opertational metrics for the controller by setting this to true |
| controller.versionMonitoring.prometheusAddress | string | `""` | The URL of the Prometheus server from which metrics related to managed application versions can be queried |
| controller.versionMonitoring.metricsEvaluationInterval | string | `"1h"` | The duration (example 2h) after which versions are evaluated for deletion; based on specified workload metrics |
| controller.versionMonitoring.promClientAcquireRetryDelay | string | `"1h"` | The duration (example 10m) to wait before retrying to acquire Prometheus client and verify connection, after a failed attempt |
Expand Down
43 changes: 43 additions & 0 deletions chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ spec:
resources:
{{- toYaml .Values.controller.resources | nindent 12 }}
env:
- name: DETAILED_OPERATIONAL_METRICS
value: "{{ .Values.controller.detailedOperationalMetrics }}"
- name: CERT_MANAGER
value: {{ .Capabilities.APIVersions.Has "cert.gardener.cloud/v1alpha1" | ternary "gardener" "cert-manager.io" }}
- name: DNS_MANAGER
Expand All @@ -95,4 +97,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: controller
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 }}
6 changes: 6 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 Expand Up @@ -69,6 +73,8 @@ controller:
volumeMounts: []
# -- The dns target mentioned on the public ingress gateway service used in the cluster
dnsTarget: ""
# -- Optionally enable detailed opertational metrics for the controller by setting this to true
detailedOperationalMetrics: false
versionMonitoring:
# -- The URL of the Prometheus server from which metrics related to managed application versions can be queried
prometheusAddress: ""
Expand Down
Loading