diff --git a/argocd/prometheus/templates/pv.yaml b/argocd/prometheus/templates/pv.yaml new file mode 100644 index 0000000..c9b3dda --- /dev/null +++ b/argocd/prometheus/templates/pv.yaml @@ -0,0 +1,21 @@ +{{- range $index, $e := until .Values.prometheus.replicas }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-prometheus-pv-{{ $index }} + annotations: + argocd.argoproj.io/sync-wave: "-10" +spec: + storageClassName: {{ .Values.storage.className }} + capacity: + storage: {{ .Values.storage.capacity }} + accessModes: + - ReadWriteOnce + claimRef: + namespace: {{ .Release.Namespace }} + name: {{ .Release.Name }}-prometheus-kube-prometheus-prometheus-db-prometheus-prometheus-kube-prometheus-prometheus-{{ $index }} + csi: + driver: csi.hetzner.cloud + volumeHandle: {{ index .Values.storage.handles $index }} + fsType: ext4 +{{- end }} \ No newline at end of file diff --git a/argocd/prometheus/test/argocd_values.yaml b/argocd/prometheus/test/argocd_values.yaml index 8ec988f..766c3f5 100644 --- a/argocd/prometheus/test/argocd_values.yaml +++ b/argocd/prometheus/test/argocd_values.yaml @@ -17,6 +17,7 @@ kube-prometheus-stack: prometheus: prometheusSpec: + replicas: &replicas 1 retention: 6h disableCompaction: true storageSpec: @@ -63,3 +64,8 @@ kube-prometheus-stack: kubeScheduler: endpoints: - 10.0.0.4 +prometheus: + replicas: *replicas +storage: + handles: + - 100068485 \ No newline at end of file diff --git a/argocd/prometheus/values.yaml b/argocd/prometheus/values.yaml index 0ac0162..7a06e01 100644 --- a/argocd/prometheus/values.yaml +++ b/argocd/prometheus/values.yaml @@ -1,4 +1,11 @@ vault: enabled: false applicationName: "" - operatorNamespace: "" \ No newline at end of file + operatorNamespace: "" +prometheus: + # must match the value provided to prometheusSpec of kube-prometheus-stack + replicas: 1 +storage: + capacity: 10Gi + className: hcloud-volumes + handles: [] \ No newline at end of file