From 67e5f5e3c338b9bf69e96baea5f135f3b090b774 Mon Sep 17 00:00:00 2001 From: majinghe <42570491+majinghe@users.noreply.github.com> Date: Tue, 10 Mar 2026 12:08:36 +0800 Subject: [PATCH] feat: add metrics support in helm chart (#2109) Signed-off-by: houseme Co-authored-by: houseme Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- helm/README.md | 2 ++ helm/rustfs/templates/configmap.yaml | 8 ++++++-- helm/rustfs/values.yaml | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/helm/README.md b/helm/README.md index 3232d1723..cc67c0049 100644 --- a/helm/README.md +++ b/helm/README.md @@ -31,6 +31,8 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | config.rustfs.log_rotation.size | int | `"100"` | Default log rotation size mb for rustfs. | | config.rustfs.log_rotation.time | string | `"hour"` | Default log rotation time for rustfs. | | config.rustfs.log_rotation.keep_files | int | `"30"` | Default log keep files for rustfs. | +| config.rustfs.metrics.enabled | bool | `true` | Toggle metrics export. | +| config.rustfs.metrics.endpoint | string | `""` | Dedicated metrics endpoint. | | containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | | | containerSecurityContext.readOnlyRootFilesystem | bool | `true` | | | containerSecurityContext.runAsNonRoot | bool | `true` | | diff --git a/helm/rustfs/templates/configmap.yaml b/helm/rustfs/templates/configmap.yaml index fc9596f7a..59d521407 100644 --- a/helm/rustfs/templates/configmap.yaml +++ b/helm/rustfs/templates/configmap.yaml @@ -41,5 +41,9 @@ data: RUSTFS_TLS_KEYLOG: "1" RUSTFS_TLS_PATH: "/opt/tls" {{- end }} - # RUSTFS_MTLS_CLIENT_CERT: "/opt/tls/client_cert.pem" - # RUSTFS_MTLS_CLIENT_KEY: "/opt/tls/client_key.pem" \ No newline at end of file + {{- if .Values.config.rustfs.metrics.enabled }} + RUSTFS_OBS_METRIC_ENDPOINT: {{ .Values.config.rustfs.metrics.endpoint | quote }} + {{- else }} + RUSTFS_OBS_METRIC_ENDPOINT: "" + RUSTFS_OBS_METRICS_EXPORT_ENABLED: "false" + {{- end }} diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 90ba2f185..b58cfd9f3 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -72,6 +72,9 @@ config: # size: 100 # Default value: 100 MB # time: hour # Default value: hour, eg: day,hour,minute,second # keep_files: 30 # number of rotated log files to keep + metrics: + enabled: false + endpoint: "" # If specified, rustfs will export metrics to this OTLP endpoint. e.g. "http://localhost:4318/v1/metrics" # This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ serviceAccount: