kubernetes-configs/apps/prometheus/prometheus.yaml
Sebastian Schüler 41ed539571 prometheus
2025-12-09 17:05:51 +01:00

66 lines
1.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
serviceAccountName: prometheus
nodeSelector:
kubernetes.io/hostname: raspberrypi
containers:
- name: prometheus
image: prom/prometheus:v2.52.0
args:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=7d
- --web.enable-lifecycle
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config
mountPath: /etc/prometheus
- name: prometheus-data
mountPath: /prometheus
resources:
requests:
memory: "256Mi"
cpu: "200m"
limits:
memory: "1Gi"
cpu: "500m"
volumes:
- name: prometheus-config
configMap:
name: prometheus-config
- name: prometheus-data
persistentVolumeClaim:
claimName: prometheus-data-pvc
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
spec:
type: NodePort
selector:
app: prometheus
ports:
- name: http
port: 9090
targetPort: 9090
nodePort: 30390
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: default