_helpers-ruler.tpl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {{/*
  2. ruler fullname
  3. */}}
  4. {{- define "loki.rulerFullname" -}}
  5. {{ include "loki.fullname" . }}-ruler
  6. {{- end }}
  7. {{/*
  8. ruler common labels
  9. */}}
  10. {{- define "loki.rulerLabels" -}}
  11. {{ include "loki.labels" . }}
  12. app.kubernetes.io/component: ruler
  13. {{- end }}
  14. {{/*
  15. ruler selector labels
  16. */}}
  17. {{- define "loki.rulerSelectorLabels" -}}
  18. {{ include "loki.selectorLabels" . }}
  19. app.kubernetes.io/component: ruler
  20. {{- end }}
  21. {{/*
  22. ruler image
  23. */}}
  24. {{- define "loki.rulerImage" -}}
  25. {{- $dict := dict "loki" .Values.loki.image "service" .Values.ruler.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion -}}
  26. {{- include "loki.lokiImage" $dict -}}
  27. {{- end }}
  28. {{/*
  29. format rules dir
  30. */}}
  31. {{- define "loki.rulerRulesDirName" -}}
  32. rules-{{ . | replace "_" "-" | trimSuffix "-" | lower }}
  33. {{- end }}
  34. {{/*
  35. ruler priority class name
  36. */}}
  37. {{- define "loki.rulerPriorityClassName" -}}
  38. {{- $pcn := coalesce .Values.global.priorityClassName .Values.ruler.priorityClassName -}}
  39. {{- if $pcn }}
  40. priorityClassName: {{ $pcn }}
  41. {{- end }}
  42. {{- end }}