From 6216b3224330d1e088415af4e56fd2dff4029fdf Mon Sep 17 00:00:00 2001 From: 0fatal <72899968+0fatal@users.noreply.github.com> Date: Wed, 23 Aug 2023 18:03:02 +0800 Subject: [PATCH] chore(build): add pvc for prometheus (#1486) --- build/Kubefile | 3 ++- build/images/shim/ImageList | 3 ++- build/prometheus-helm.yaml | 8 ++++++++ build/start.sh | 8 +++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/build/Kubefile b/build/Kubefile index 84ef49e247..6fddeba8d3 100644 --- a/build/Kubefile +++ b/build/Kubefile @@ -16,5 +16,6 @@ ENV ENABLE_APISIX_HOST_NETWORK=true ENV DB_PV_SIZE=10Gi ENV OSS_PV_SIZE=20Gi +ENV PROMETHEUS_PV_SIZE=20Gi -CMD ["DOMAIN=$(DOMAIN) REGION=$(REGION) NAMESPACE=$(NAMESPACE) EXTERNAL_HTTP_SCHEMA=$(EXTERNAL_HTTP_SCHEMA) INTERNAL_HTTP_SCHEMA=$(INTERNAL_HTTP_SCHEMA) ENABLE_APISIX_HOST_NETWORK=$(ENABLE_APISIX_HOST_NETWORK) DB_PV_SIZE=$(DB_PV_SIZE) OSS_PV_SIZE=$(OSS_PV_SIZE) sh start.sh"] \ No newline at end of file +CMD ["DOMAIN=$(DOMAIN) REGION=$(REGION) NAMESPACE=$(NAMESPACE) EXTERNAL_HTTP_SCHEMA=$(EXTERNAL_HTTP_SCHEMA) INTERNAL_HTTP_SCHEMA=$(INTERNAL_HTTP_SCHEMA) ENABLE_APISIX_HOST_NETWORK=$(ENABLE_APISIX_HOST_NETWORK) DB_PV_SIZE=$(DB_PV_SIZE) OSS_PV_SIZE=$(OSS_PV_SIZE) PROMETHEUS_PV_SIZE=$(PROMETHEUS_PV_SIZE) sh start.sh"] \ No newline at end of file diff --git a/build/images/shim/ImageList b/build/images/shim/ImageList index b27e71e139..0fd6b006fa 100644 --- a/build/images/shim/ImageList +++ b/build/images/shim/ImageList @@ -5,4 +5,5 @@ quay.io/minio/minio:RELEASE.2023-03-22T06-36-24Z quay.io/minio/mc:RELEASE.2022-11-07T23-47-39Z quay.io/coreos/etcd:v3.5.4 ghcr.io/labring/sealos-resources-controller:9a013cea -ghcr.io/labring/sealos-resources-metering-controller:9a013cea \ No newline at end of file +ghcr.io/labring/sealos-resources-metering-controller:9a013cea +registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20221220-controller-v1.5.1-58-g787ea74b6 diff --git a/build/prometheus-helm.yaml b/build/prometheus-helm.yaml index 827e82ef26..a7e336d2e5 100644 --- a/build/prometheus-helm.yaml +++ b/build/prometheus-helm.yaml @@ -20,6 +20,14 @@ kubeProxy: kubeStateMetrics: enabled: false prometheus: + prometheusSpec: + storageSpec: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: $PROMETHEUS_PV_SIZE networkPolicy: enabled: true ingress: diff --git a/build/start.sh b/build/start.sh index 67ff5a45bb..1b38dcade5 100644 --- a/build/start.sh +++ b/build/start.sh @@ -83,13 +83,15 @@ if [ $ENABLE_MONITOR ]; then helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update - sed "s/\$NAMESPACE/$NAMESPACE/g" prometheus-helm.yaml > prometheus-helm-with-values.yaml + sed -e "s/\$NAMESPACE/$NAMESPACE/g" \ + -e "s/\$PROMETHEUS_PV_SIZE/${PROMETHEUS_PV_SIZE:-20Gi}/g" \ + prometheus-helm.yaml > prometheus-helm-with-values.yaml - helm install prometheus -n ${NAMESPACE} \ + helm install prometheus --version 48.3.3 -n ${NAMESPACE} \ -f ./prometheus-helm-with-values.yaml \ prometheus-community/kube-prometheus-stack - helm install prometheus-mongodb-exporter -n ${NAMESPACE} \ + helm install prometheus-mongodb-exporter --version 3.2.0 -n ${NAMESPACE} \ --set mongodb.uri=${DATABASE_URL} \ --set serviceMonitor.enabled=true \ --set serviceMonitor.additionalLabels.release=prometheus \