persistentVolumeClaim |
object |
diff --git a/pkg/apis/v1alpha1/types.go b/pkg/apis/v1alpha1/types.go
index b6fbbe4e8..1ffbb71ae 100644
--- a/pkg/apis/v1alpha1/types.go
+++ b/pkg/apis/v1alpha1/types.go
@@ -88,6 +88,9 @@ type PrometheusConfig struct {
// Define persistent volume claim for prometheus
// +optional
PersistentVolumeClaim *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaim,omitempty"`
+ // Define ExternalLabels for prometheus
+ // +optional
+ ExternalLabels map[string]string `json:"externalLabels,omitempty"`
}
// NamespaceSelector is a selector for selecting either all namespaces or a
diff --git a/pkg/apis/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/v1alpha1/zz_generated.deepcopy.go
index a7628403a..be10fabd8 100644
--- a/pkg/apis/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/v1alpha1/zz_generated.deepcopy.go
@@ -163,6 +163,13 @@ func (in *PrometheusConfig) DeepCopyInto(out *PrometheusConfig) {
*out = new(corev1.PersistentVolumeClaimSpec)
(*in).DeepCopyInto(*out)
}
+ if in.ExternalLabels != nil {
+ in, out := &in.ExternalLabels, &out.ExternalLabels
+ *out = make(map[string]string, len(*in))
+ for key, val := range *in {
+ (*out)[key] = val
+ }
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusConfig.
diff --git a/pkg/controllers/monitoring-stack/components.go b/pkg/controllers/monitoring-stack/components.go
index 1c41d32c0..12dbac53d 100644
--- a/pkg/controllers/monitoring-stack/components.go
+++ b/pkg/controllers/monitoring-stack/components.go
@@ -489,8 +489,9 @@ func newPrometheus(
BaseImage: stringPtr("quay.io/thanos/thanos"),
Version: stringPtr("v0.24.0"),
},
- Storage: storageForPVC(config.PersistentVolumeClaim),
- RemoteWrite: config.RemoteWrite,
+ Storage: storageForPVC(config.PersistentVolumeClaim),
+ RemoteWrite: config.RemoteWrite,
+ ExternalLabels: config.ExternalLabels,
},
}
|