prometheus-dep.yaml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. apiVersion: apps/v1beta2
  3. kind: Deployment
  4. metadata:
  5. name: prometheus
  6. namespace: monitoring
  7. spec:
  8. replicas: 1
  9. selector:
  10. matchLabels:
  11. app: prometheus
  12. template:
  13. metadata:
  14. labels:
  15. app: prometheus
  16. annotations:
  17. prometheus.io/scrape: 'false'
  18. spec:
  19. serviceAccountName: prometheus
  20. containers:
  21. - name: prometheus
  22. image: prom/prometheus:v2.1.0
  23. imagePullPolicy: Always
  24. command:
  25. - prometheus
  26. - --config.file=/etc/prometheus/prometheus.yml
  27. - --storage.tsdb.retention=1h
  28. ports:
  29. - containerPort: 9090
  30. protocol: TCP
  31. resources:
  32. limits:
  33. memory: 2Gi
  34. volumeMounts:
  35. - mountPath: /etc/prometheus/prometheus.yml
  36. name: prometheus-config
  37. subPath: prometheus.yml
  38. volumes:
  39. - name: prometheus-config
  40. configMap:
  41. name: prometheus-config
  42. items:
  43. - key: prometheus.yml
  44. path: prometheus.yml
  45. mode: 0644