Skip to content
Snippets Groups Projects
Commit e24f1fde authored by Nacho Barrientos's avatar Nacho Barrientos
Browse files

Make sure that k8s_cluster_name is set when it has to

The agreement is that if a custom remote write is configured and the
local fluent-bit forward is not enabled then the users will have a
green field labels-wise and the k8s_cluster_name label won't be
enforced.
parent 417adebf
No related branches found
No related tags found
1 merge request!55Make sure that k8s_cluster_name is set when it has to
Pipeline #11010693 passed
......@@ -21,7 +21,7 @@ tests:
apiVersion: "monitoring.coreos.com/v1"
name: it-monit-metrics-collector-prometheus
not: true
- it: should be deployed with cluster-local remote write by default
- it: should be deployed with cluster-local remote write by default and k8s_cluster_name set
set:
kubernetes.clusterName: test
asserts:
......@@ -35,6 +35,9 @@ tests:
- equal:
path: spec.remoteWrite[0].url
value: "http://it-monit-metrics-fluentbit:8080/api/prom/push"
- equal:
path: spec.externalLabels.k8s_cluster_name
value: test
- it: should be deployed with no remoteWrites if no fluentbit is available
set:
kubernetes.clusterName: test
......@@ -47,7 +50,7 @@ tests:
- lengthEqual:
path: spec.remoteWrite
count: 0
- it: should be deployed with external remote write if configured
- it: should be deployed with external remote write if configured and no external labels
set:
kubernetes.clusterName: test
metrics.fluentbit.enabled: false
......@@ -70,6 +73,8 @@ tests:
password:
name: it-monit-metrics-collector-prometheus
key: password
- isNullOrEmpty:
path: spec.externalLabels
- lengthEqual:
path: spec.remoteWrite
count: 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment