apiVersion: apps/v1 kind: Deployment metadata: name: prometheus namespace: monitoring spec: replicas: 1 selector: matchLabels: app: prometheus template: metadata: labels: app: prometheus spec: serviceAccountName: prometheus securityContext: fsGroup: 65534 containers: - name: prometheus image: docker.io/prom/prometheus:latest imagePullPolicy: IfNotPresent args: - "--config.file=/etc/prometheus/prometheus.yml" - "--storage.tsdb.path=/prometheus" - "--storage.tsdb.retention.time=15d" - "--web.enable-lifecycle" ports: - name: http containerPort: 9090 volumeMounts: - name: prometheus-config mountPath: /etc/prometheus readOnly: true - name: prometheus-data mountPath: /prometheus volumes: - name: prometheus-config configMap: name: prometheus-config - name: prometheus-data persistentVolumeClaim: claimName: prometheus-data