From 5df96cc1631f91a1211bade956cb3a644c0663d2 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Thu, 24 Apr 2025 19:25:46 +0200 Subject: [PATCH 1/2] fix(opencloud): allow to set proxy_basic_auth --- Chart.yaml | 2 +- templates/opencloud/deployment.yaml | 2 +- values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 4cf0bcd1..d0aed54b 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -10,7 +10,7 @@ maintainers: email: info@opencloud.eu url: https://opencloud.eu type: application -version: 0.1.2 +version: 0.1.3 # renovate: datasource=docker depName=opencloudeu/opencloud-rolling appVersion: latest kubeVersion: "" diff --git a/templates/opencloud/deployment.yaml b/templates/opencloud/deployment.yaml index aed92007..df71e6d9 100644 --- a/templates/opencloud/deployment.yaml +++ b/templates/opencloud/deployment.yaml @@ -157,7 +157,7 @@ spec: value: "{{ .Values.opencloud.insecure }}" # Basic auth (only needed when not using Keycloak) - name: PROXY_ENABLE_BASIC_AUTH - value: {{ if .Values.keycloak.enabled }}"false"{{ else }}"true"{{ end }} + value: {{ tpl (toString .Values.opencloud.enableBasicAuth) . | quote }} # These vars are needed to the csp config file to include the web office apps and the importer - name: ONLYOFFICE_DOMAIN value: "{{ .Values.global.domain.onlyoffice }}" diff --git a/values.yaml b/values.yaml index 8947928e..b102f438 100644 --- a/values.yaml +++ b/values.yaml @@ -376,7 +376,7 @@ opencloud: # Insecure mode (for self-signed certificates) insecure: true # Enable basic auth (set to false to use Keycloak only) - enableBasicAuth: false + enableBasicAuth: "{{ not .Values.keycloak.enabled }}" # Admin password adminPassword: admin # Create demo users From af419659839fa7bc8fe1718ae7f06da8493447d4 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Thu, 24 Apr 2025 21:34:26 +0200 Subject: [PATCH 2/2] fix(opencloud): start monitoring with prometheus --- templates/opencloud/deployment.yaml | 8 ++++++++ templates/opencloud/service.yaml | 6 ++++++ templates/servicemonitor.yaml | 19 +++++++++++++++++++ values.yaml | 10 ++++++++++ 4 files changed, 43 insertions(+) create mode 100644 templates/servicemonitor.yaml diff --git a/templates/opencloud/deployment.yaml b/templates/opencloud/deployment.yaml index df71e6d9..285a789a 100644 --- a/templates/opencloud/deployment.yaml +++ b/templates/opencloud/deployment.yaml @@ -146,6 +146,10 @@ spec: - name: OC_EXCLUDE_RUN_SERVICES value: {{ join "," . | quote }} {{- end }} + {{- if .Values.prometheus.enabled }} + - name: "PROXY_DEBUG_ADDR" + value: ":9205" + {{- end }} # Do not use SSL between proxy and OpenCloud - name: PROXY_TLS value: "false" @@ -269,6 +273,10 @@ spec: ports: - name: http containerPort: 9200 + {{- if .Values.prometheus.enabled }} + - name: metrics + containerPort: 9205 + {{- end }} - name: nats containerPort: 9233 startupProbe: diff --git a/templates/opencloud/service.yaml b/templates/opencloud/service.yaml index 1eec697f..41d32f57 100644 --- a/templates/opencloud/service.yaml +++ b/templates/opencloud/service.yaml @@ -14,6 +14,12 @@ spec: targetPort: http protocol: TCP name: http + {{- if .Values.prometheus.enabled }} + - port: 9205 + targetPort: metrics + protocol: TCP + name: metrics + {{- end }} - port: 9233 targetPort: 9233 protocol: TCP diff --git a/templates/servicemonitor.yaml b/templates/servicemonitor.yaml new file mode 100644 index 00000000..44fa82cc --- /dev/null +++ b/templates/servicemonitor.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.prometheus.enabled .Values.prometheus.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: Service +metadata: + name: {{ include "opencloud.opencloud.fullname" . }} + namespace: {{ include "opencloud.namespace" . }} + labels: + {{- include "opencloud.labels" . | nindent 4 }} + {{- with .Values.prometheus.serviceMonitor.labels }} + {{- toYaml . | nindent 4}} + {{- end }} +spec: + selector: + matchLabels: + {{- include "opencloud.selectorLabels" . | nindent 4 }} + endpoints: + - port: metrics + path: "/metrics" +{{- end }} diff --git a/values.yaml b/values.yaml index b102f438..9f7fc806 100644 --- a/values.yaml +++ b/values.yaml @@ -499,6 +499,16 @@ opencloud: # Create bucket if it doesn't exist createBucket: true +# ===================================================================== +# Monitoring prometheus +# ===================================================================== + +prometheus: + enabled: true + serviceMonitor: + enabled: true + labels: {} + # ===================================================================== # GATEWAY-API HTTPRoute # =====================================================================