Skip to content

Commit

Permalink
chore(build): add pvc for prometheus (#1486)
Browse files Browse the repository at this point in the history
  • Loading branch information
0fatal authored Aug 23, 2023
1 parent 76238d7 commit 6216b32
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build/Kubefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
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"]
3 changes: 2 additions & 1 deletion build/images/shim/ImageList
Original file line number Diff line number Diff line change
Expand Up @@ -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
ghcr.io/labring/sealos-resources-metering-controller:9a013cea
registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20221220-controller-v1.5.1-58-g787ea74b6
8 changes: 8 additions & 0 deletions build/prometheus-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions build/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 6216b32

Please sign in to comment.