operator
operator copied to clipboard
VMOperator: Filter namespaces by labels
Is your feature request related to a problem? Please describe
I'd like to adopt VictoriaMetrics from Kube-Prometheus-Stack, one of my need is to convert Prometheus-Operator objects to VictoriaMetrics ones within a fixed list of namespaces.
Describe the solution you'd like
Add a namespace selector with labels to the VM Operator to restrict objects to convert
Describe alternatives you've considered
No response
Additional information
No response
Hello! I will convert this to operator repo since it's about operator)
one of my need is to convert Prometheus-Operator objects to VictoriaMetrics ones within a fixed list of namespaces.
For now, vm operator only support single namespace or all namespaces. Related to https://github.com/VictoriaMetrics/operator/issues/557
Must be fixed at v0.42.0 release
It supports comma separated values for WATCH_NAMESPACE env variable.
I don't believe that filtering by labels make sense, since kubernetes API doesn't support that for object requests.
In multitenant clusters, I only want to scrape my clients, or a set of client namespaced objects for conversion. I don't know my client namespace exact names (only the prefixes) but I for sure know that their namespace have a specific label. How am I supposed to do this? Thank you
In multitenant clusters, I only want to scrape my clients, or a set of client namespaced objects for conversion. I don't know my client namespace exact names (only the prefixes) but I for sure know that their namespace have a specific label. How am I supposed to do this? Thank you
I think, it's possible with namespace selectors for vmagent.
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
name: only-tenants-match
spec:
serviceScrapeSelector: {}
serviceScrapeNamespaceSelector:
matchExpressions:
- operator: In
key: my-namespace-common-tenant-label
values: ["tenant-1","tenant-2","tenant-3"]
It must select scrape objects from namespaces that has a common label my-namespace-common-tenant-label and it's value in defined set of values.
It shouldn't be a problem to assign label to the namespace as part of monitoring "contract".
I'd suggest to create vmagent with predefined configuration by cluster admins.