sandbox/charts/open-meteo-service/templates/prometheus-deployment.yaml

55 lines
1.9 KiB
YAML

{{- if .Values.prometheus.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "open-meteo-service.prometheusFullname" . }}
labels:
{{- include "open-meteo-service.labels" . | nindent 4 }}
app.kubernetes.io/component: prometheus
spec:
replicas: {{ .Values.prometheus.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "open-meteo-service.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: prometheus
template:
metadata:
labels:
{{- include "open-meteo-service.labels" . | nindent 8 }}
app.kubernetes.io/component: prometheus
spec:
containers:
- name: prometheus
image: {{ .Values.prometheus.image | quote }}
ports:
- name: http
containerPort: {{ .Values.prometheus.service.port }}
protocol: TCP
args:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
{{- range .Values.prometheus.extraArgs }}
- {{ . | quote }}
{{- end }}
volumeMounts:
- name: prometheus-config
mountPath: /etc/prometheus/prometheus.yml
subPath: prometheus.yml
- name: prometheus-data
mountPath: /prometheus
resources:
{{- toYaml .Values.prometheus.resources | nindent 12 }}
volumes:
- name: prometheus-config
configMap:
name: {{ include "open-meteo-service.prometheusFullname" . }}
- name: prometheus-data
{{- if .Values.prometheus.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "open-meteo-service.prometheusFullname" . }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}