_statsd.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {{/*
  2. The exporter container attached to every Mastodon pod
  3. */}}
  4. {{- define "mastodon.statsdExporterContainer" }}
  5. {{- with .Values.mastodon.metrics.statsd }}
  6. {{- if and .exporter.enabled (not .address) }}
  7. - name: statsd-exporter
  8. image: prom/statsd-exporter
  9. args:
  10. - "--statsd.mapping-config=/statsd-mappings/mastodon.yml"
  11. resources:
  12. requests:
  13. cpu: "0.1"
  14. memory: "180M"
  15. limits:
  16. cpu: "0.5"
  17. memory: "250M"
  18. ports:
  19. - name: statsd
  20. containerPort: {{ .exporter.port }}
  21. volumeMounts:
  22. - name: statsd-mappings
  23. mountPath: /statsd-mappings
  24. {{- end }}
  25. {{- end }}
  26. {{- end }}
  27. {{/*
  28. The volume needed for the container above
  29. */}}
  30. {{- define "mastodon.statsdExporterVolume" }}
  31. {{- with .Values.mastodon.metrics.statsd }}
  32. {{- if and .exporter.enabled (not .address) }}
  33. - name: statsd-mappings
  34. configMap:
  35. name: {{ include "mastodon.fullname" $ }}-statsd-mappings
  36. items:
  37. - key: mastodon-statsd-mappings.yml
  38. path: mastodon.yml
  39. {{- end }}
  40. {{- end }}
  41. {{- end }}
  42. {{/*
  43. Labels added to every statsd_exporter-enabled pod
  44. */}}
  45. {{- define "mastodon.statsdExporterLabels" }}
  46. {{- with .Values.mastodon.metrics.statsd }}
  47. {{- if and .exporter.enabled (not .address) }}
  48. mastodon/statsd-exporter: "true"
  49. {{- end }}
  50. {{- end }}
  51. {{- end }}