Support for RemoteWrite CRD

Author: superbrothersCreated Apr 14, 2024Updated Aug 25, 2026
Labelshelp wantedkind/feature

Component(s)

Prometheus

What is missing? Please describe.

I would like to allow users to add arbitrary RemoteWrite/Read configs to Prometheus.

Scenario: cluster-admin provides a managed Prometheus server to users using Prometheus CR. This Prometheus CR can only be modified by cluster-admin. The user adds config to the Prometheus server using a RemoteWrite CR to forward metrics to an external managed Prometheus service.

yaml
apiVersion: monitoring.coreos.com/v1alpha1
kind: RemoteWrite
metadata:
  name: example
  namespace: default
spec:
  url: xxxx/api/v1/remote_write
  authorization:
    name: cred
    key: token
  writeRelabelConfigs:
  - ...
yaml
apiVersion: monitoring.coreos.com/v1alpha1
kind: RemoteRead
metadata:
  name: example
  namespace: default
spec:
  url: xxxx/api/v1/read
  sigv4:
    region: ap-northeast-1
yaml
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: prometheus
  namespace: monitoring
spec:
  RemoteWriteNamespaceSelector: {}
  RemoteWriteSelector: {}
  RemoteReadNamespaceSelector: {}
  RemoteReadSelector: {}

Since RemoteWrite/Read CR are namespaced resources, it may be better to limit the target metrics to the namespace in which the object was created.

Describe alternatives you've considered.

None.

Environment Information.

Environment

Kubernetes Version: Prometheus-Operator Version:

Source: prometheus-operator/prometheus-operator