diff --git a/kubernetes-services/templates/prometheus.yaml b/kubernetes-services/templates/prometheus.yaml index 5428c959..f7bbd50c 100644 --- a/kubernetes-services/templates/prometheus.yaml +++ b/kubernetes-services/templates/prometheus.yaml @@ -13,7 +13,7 @@ spec: sources: - chart: kube-prometheus-stack repoURL: https://prometheus-community.github.io/helm-charts - targetRevision: 71.1.0 + targetRevision: 75.6.1 helm: values: | prometheusOperator: @@ -71,6 +71,18 @@ spec: storageClassName: longhorn accessModes: ["ReadWriteOnce"] size: 1Gi + initChownData: + securityContext: + runAsNonRoot: false + runAsUser: 0 + seccompProfile: + type: RuntimeDefault + capabilities: + add: + - CHOWN + - DAC_READ_SEARCH + drop: + - ALL - path: ./kubernetes-services/additions/prometheus repoURL: https://github.com/procinger/turing-pi-v2-cluster.git targetRevision: main diff --git a/test/prometheus_test.go b/test/prometheus_test.go index 726152ea..dabbfbdf 100644 --- a/test/prometheus_test.go +++ b/test/prometheus_test.go @@ -51,9 +51,43 @@ func TestPrometheus(t *testing.T) { ) promCurrent.Spec.Sources[i].Helm.Values = source.Helm.Values - if promUpdate.Spec.Sources != nil { - promUpdate.Spec.Sources[i].Helm.Values = source.Helm.Values + } + + for i, source := range promUpdate.Spec.Sources { + if source.Chart == "" { + continue } + // replace storageClass; we do not have longhorn in ci + source.Helm.Values = strings.Replace( + source.Helm.Values, + "longhorn", + "standard", + -1, + ) + + // also shrink volume + source.Helm.Values = strings.Replace( + source.Helm.Values, + "storage: 20Gi", + "storage: 500Mi", + -1, + ) + + source.Helm.Values = strings.Replace( + source.Helm.Values, + "storage: 5Gi", + "storage: 500Mi", + -1, + ) + + source.Helm.Values = strings.Replace( + source.Helm.Values, + "size: 1Gi", + "size: 100Mi", + -1, + ) + + promUpdate.Spec.Sources[i].Helm.Values = source.Helm.Values } client, err := test.GetClient()