template.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. kind: compose
  2. metadata:
  3. icon:
  4. provider: selfh
  5. id: prometheus
  6. name: Prometheus
  7. description: 'Prometheus is an open-source systems monitoring and alerting toolkit
  8. originally built at SoundCloud.
  9. It is designed for reliability and scalability, making it suitable for monitoring
  10. dynamic cloud environments.
  11. Prometheus collects and stores metrics as time series data, providing powerful
  12. querying capabilities and integration with various visualization tools.
  13. ## Swarm Deployment Warning
  14. Prometheus uses local TSDB storage and does NOT support running multiple replicas.
  15. This template enforces a single replica with node placement constraints. For true
  16. HA, consider remote storage solutions (Thanos, Cortex, VictoriaMetrics).
  17. Project: https://prometheus.io/
  18. Documentation: https://prometheus.io/docs/
  19. GitHub: https://github.com/prometheus/prometheus
  20. '
  21. version: v3.9.1
  22. author: Christian Lempa
  23. date: '2026-01-07'
  24. tags:
  25. - traefik
  26. - swarm
  27. - authentik
  28. next_steps: "{% if swarm_enabled -%}\n1. Deploy to Docker Swarm:\n docker stack\
  29. \ deploy -c compose.yaml {{ service_name }}\n2. Access Prometheus:\n {%- if\
  30. \ traefik_enabled %} https://{{ traefik_host }}\n {%- else %} http://<swarm-node-ip>:{{\
  31. \ ports_http }}{%- endif %}\n{% else -%}\n1. Start Prometheus with Docker Compose:\n\
  32. \ docker compose up -d\n2. Access Prometheus:\n {%- if traefik_enabled %}\
  33. \ https://{{ traefik_host }}\n {%- else %} http://localhost:{{ ports_http }}{%-\
  34. \ endif %}\n{% endif -%}\n3. Edit config/prometheus.yaml to add scrape targets\n\
  35. 4. Reload configuration: docker exec {{ container_name if not swarm_enabled else\
  36. \ service_name }} kill -HUP 1\n"
  37. schema: '1.2'
  38. spec:
  39. general:
  40. vars:
  41. service_name:
  42. default: prometheus
  43. restart_policy:
  44. type: enum
  45. options:
  46. - unless-stopped
  47. - always
  48. - on-failure
  49. - 'no'
  50. default: unless-stopped
  51. required: true
  52. metrics:
  53. title: Metrics & Storage
  54. description: Configure data retention and storage settings
  55. vars:
  56. metrics_retention_time:
  57. type: str
  58. description: How long to retain samples (e.g., 15d, 30d, 1y)
  59. default: 15d
  60. extra: Older data will be deleted. Use 'h', 'd', 'w', 'y' for time units.
  61. metrics_retention_size:
  62. type: str
  63. description: Maximum storage size (e.g., 5GB, 10GB, 1TB)
  64. default: '0'
  65. extra: Set to 0 for unlimited. Triggers deletion when exceeded.
  66. metrics_enable_remote_write:
  67. type: bool
  68. description: Enable remote write receiver (allows pushing metrics via /api/v1/write)
  69. default: false
  70. extra: 'Caution: Intended for low-volume use cases only. Not efficient for
  71. general ingestion.'
  72. ports:
  73. vars:
  74. ports_http:
  75. default: 9090
  76. traefik:
  77. vars:
  78. traefik_host:
  79. default: prometheus
  80. traefik_network:
  81. default: traefik
  82. type: str
  83. required: true
  84. traefik_domain:
  85. default: home.arpa
  86. type: str
  87. required: true
  88. traefik_enabled:
  89. type: bool
  90. default: false
  91. description: Enable Traefik integration
  92. toggle: traefik_enabled
  93. title: Traefik
  94. description: Configure Traefik reverse proxy integration
  95. traefik_tls:
  96. vars:
  97. traefik_tls_certresolver:
  98. type: str
  99. default: cloudflare
  100. required: true
  101. traefik_tls_enabled:
  102. type: bool
  103. default: false
  104. description: Enable Traefik TLS
  105. toggle: traefik_tls_enabled
  106. title: Traefik TLS
  107. description: Configure Traefik TLS/SSL certificates
  108. needs: traefik