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: ...@@ -21,7 +21,7 @@ tests:
apiVersion: "monitoring.coreos.com/v1" apiVersion: "monitoring.coreos.com/v1"
name: it-monit-metrics-collector-prometheus name: it-monit-metrics-collector-prometheus
not: true 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: set:
kubernetes.clusterName: test kubernetes.clusterName: test
asserts: asserts:
...@@ -35,6 +35,9 @@ tests: ...@@ -35,6 +35,9 @@ tests:
- equal: - equal:
path: spec.remoteWrite[0].url path: spec.remoteWrite[0].url
value: "http://it-monit-metrics-fluentbit:8080/api/prom/push" 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 - it: should be deployed with no remoteWrites if no fluentbit is available
set: set:
kubernetes.clusterName: test kubernetes.clusterName: test
...@@ -47,7 +50,7 @@ tests: ...@@ -47,7 +50,7 @@ tests:
- lengthEqual: - lengthEqual:
path: spec.remoteWrite path: spec.remoteWrite
count: 0 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: set:
kubernetes.clusterName: test kubernetes.clusterName: test
metrics.fluentbit.enabled: false metrics.fluentbit.enabled: false
...@@ -70,6 +73,8 @@ tests: ...@@ -70,6 +73,8 @@ tests:
password: password:
name: it-monit-metrics-collector-prometheus name: it-monit-metrics-collector-prometheus
key: password key: password
- isNullOrEmpty:
path: spec.externalLabels
- lengthEqual: - lengthEqual:
path: spec.remoteWrite path: spec.remoteWrite
count: 1 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