apiVersion: apps/v1 kind: Deployment metadata: name: prometheus-deployment labels: app: prometheus spec: replicas: 1 selector: matchLabels: app: prometheus template: metadata: labels: app: prometheus spec: containers: - name: prometheus image: prom/prometheus args: - '--web.external-url=/kubernetes/prometheus/' - '--web.route-prefix=/kubernetes/prometheus/' - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/data' - '--web.console.libraries=/usr/share/prometheus/console_libraries' ports: - name: prometheus-port containerPort: 9090 protocol: TCP volumeMounts: - name: prometheus-config mountPath: /etc/prometheus/prometheus.yml subPath: prometheus.yml - name: prometheus-volume mountPath: /data volumes: - name: prometheus-config configMap: name: prometheus-configmap - name: prometheus-volume persistentVolumeClaim: claimName: pvc-prometheus