Files
Timofei Larkin 95e4faf68e feat(workloadmonitor): bucket metrics endpoint override
The controller discovers where to query SeaweedFS bucket size metrics
via the namespace.cozystack.io/monitoring label, which assumes the
monitoring stack that scrapes SeaweedFS runs in the same cluster. Some
deployments host SeaweedFS and its metrics in a separate cluster, so
add a --seaweedfs-metrics-endpoint flag to cozystack-controller (and a
matching cozystackController.seaweedfsMetricsEndpoint chart value): an
explicit base URL of a Prometheus-compatible query API, with scheme,
host, optional port and path prefix; /api/v1/query is appended. Basic
auth may be embedded as URL userinfo. The flag is validated and
normalized at startup, so a malformed URL fails the rollout rather
than the queries. Empty keeps label-based discovery unchanged.

Bucket sizes feed billing, so metrics failures no longer collapse to
"no size": previously any query failure yielded an empty result map
and the reconciler overwrote Workload resources with it, silently
wiping the recorded sizes. The reconciler now retains the last known
s3-storage-bytes and s3-physical-storage-bytes values, emits a
BucketMetricsUnavailable warning event on the WorkloadMonitor, and
returns the error from Reconcile so it lands in the reconcile error
metrics.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-07-23 15:35:00 +03:00

33 lines
857 B
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: cozystack-controller
labels:
app: cozystack-controller
spec:
replicas: 1
selector:
matchLabels:
app: cozystack-controller
template:
metadata:
labels:
app: cozystack-controller
spec:
serviceAccountName: cozystack-controller
containers:
- name: cozystack-controller
image: "{{ .Values.cozystackController.image }}"
args:
{{- if .Values.cozystackController.debug }}
- --zap-log-level=debug
{{- else }}
- --zap-log-level=info
{{- end }}
{{- if .Values.cozystackController.disableTelemetry }}
- --disable-telemetry
{{- end }}
{{- with .Values.cozystackController.seaweedfsMetricsEndpoint }}
- --seaweedfs-metrics-endpoint={{ . }}
{{- end }}