github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml (about)

     1  {{- if .Values.thanosRuler.enabled }}
     2  apiVersion: monitoring.coreos.com/v1
     3  kind: ThanosRuler
     4  metadata:
     5    name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
     6    namespace: {{ template "kube-prometheus-stack.namespace" . }}
     7    labels:
     8      app: {{ include "kube-prometheus-stack.thanosRuler.name" . }}
     9  {{- include "kube-prometheus-stack.labels" . | indent 4 -}}
    10  {{- if .Values.thanosRuler.annotations }}
    11    annotations:
    12  {{ toYaml .Values.thanosRuler.annotations | indent 4 }}
    13  {{- end }}
    14  spec:
    15  {{- if .Values.thanosRuler.thanosRulerSpec.image }}
    16    {{- $registry := .Values.global.imageRegistry | default .Values.thanosRuler.thanosRulerSpec.image.registry -}}
    17    {{- if and .Values.thanosRuler.thanosRulerSpec.image.tag .Values.thanosRuler.thanosRulerSpec.image.sha }}
    18    image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}:{{ .Values.thanosRuler.thanosRulerSpec.image.tag }}@sha256:{{ .Values.thanosRuler.thanosRulerSpec.image.sha }}"
    19    {{- else if .Values.thanosRuler.thanosRulerSpec.image.sha }}
    20    image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}@sha256:{{ .Values.thanosRuler.thanosRulerSpec.image.sha }}"
    21    {{- else if .Values.thanosRuler.thanosRulerSpec.image.tag }}
    22    image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}:{{ .Values.thanosRuler.thanosRulerSpec.image.tag }}"
    23    {{- else }}
    24    image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}"
    25    {{- end }}
    26    {{- if .Values.thanosRuler.thanosRulerSpec.image.sha }}
    27    sha: {{ .Values.thanosRuler.thanosRulerSpec.image.sha }}
    28    {{- end }}
    29  {{- end }}
    30    replicas: {{ .Values.thanosRuler.thanosRulerSpec.replicas }}
    31    listenLocal: {{ .Values.thanosRuler.thanosRulerSpec.listenLocal }}
    32    serviceAccountName: {{ template "kube-prometheus-stack.thanosRuler.serviceAccountName" . }}
    33  {{- if .Values.thanosRuler.thanosRulerSpec.externalPrefix }}
    34    externalPrefix: "{{ tpl .Values.thanosRuler.thanosRulerSpec.externalPrefix . }}"
    35  {{- else if and .Values.thanosRuler.ingress.enabled .Values.thanosRuler.ingress.hosts }}
    36    externalPrefix: "http://{{ tpl (index .Values.thanosRuler.ingress.hosts 0) . }}{{ .Values.thanosRuler.thanosRulerSpec.routePrefix }}"
    37  {{- else }}
    38    externalPrefix: http://{{ template "kube-prometheus-stack.thanosRuler.name" . }}.{{ template "kube-prometheus-stack.namespace" . }}:{{ .Values.thanosRuler.service.port }}
    39  {{- end }}
    40  {{- if .Values.thanosRuler.thanosRulerSpec.nodeSelector }}
    41    nodeSelector:
    42  {{ toYaml .Values.thanosRuler.thanosRulerSpec.nodeSelector | indent 4 }}
    43  {{- end }}
    44    paused: {{ .Values.thanosRuler.thanosRulerSpec.paused }}
    45    logFormat: {{ .Values.thanosRuler.thanosRulerSpec.logFormat | quote  }}
    46    logLevel:  {{ .Values.thanosRuler.thanosRulerSpec.logLevel | quote  }}
    47    retention: {{ .Values.thanosRuler.thanosRulerSpec.retention | quote  }}
    48  {{- if .Values.thanosRuler.thanosRulerSpec.evaluationInterval }}
    49    evaluationInterval: {{ .Values.thanosRuler.thanosRulerSpec.evaluationInterval }}
    50  {{- end }}
    51  {{- if .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector }}
    52    ruleNamespaceSelector:
    53  {{ toYaml .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector | indent 4 }}
    54  {{ else }}
    55    ruleNamespaceSelector: {}
    56  {{- end }}
    57  {{- if .Values.thanosRuler.thanosRulerSpec.ruleSelector }}
    58    ruleSelector:
    59  {{ toYaml .Values.thanosRuler.thanosRulerSpec.ruleSelector | indent 4}}
    60  {{- else if .Values.thanosRuler.thanosRulerSpec.ruleSelectorNilUsesHelmValues }}
    61    ruleSelector:
    62      matchLabels:
    63        release: {{ $.Release.Name | quote }}
    64  {{ else }}
    65    ruleSelector: {}
    66  {{- end }}
    67  {{- if .Values.thanosRuler.thanosRulerSpec.alertQueryUrl }}
    68    alertQueryUrl: "{{ .Values.thanosRuler.thanosRulerSpec.alertQueryUrl }}"
    69  {{- end}}
    70  {{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersUrl }}
    71    alertmanagersUrl:
    72  {{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersUrl | indent 4 }}
    73  {{- end }}
    74  {{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }}
    75    alertmanagersConfig:
    76  {{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig | indent 4 }}
    77  {{- end }}
    78  {{- if .Values.thanosRuler.thanosRulerSpec.queryEndpoints }}
    79    queryEndpoints:
    80  {{ toYaml .Values.thanosRuler.thanosRulerSpec.queryEndpoints | indent 4 }}
    81  {{- end }}
    82  {{- if .Values.thanosRuler.thanosRulerSpec.queryConfig }}
    83    queryConfig:
    84  {{ toYaml .Values.thanosRuler.thanosRulerSpec.queryConfig | indent 4 }}
    85  {{- end }}
    86  {{- if .Values.thanosRuler.thanosRulerSpec.resources }}
    87    resources:
    88  {{ toYaml .Values.thanosRuler.thanosRulerSpec.resources | indent 4 }}
    89  {{- end }}
    90  {{- if .Values.thanosRuler.thanosRulerSpec.routePrefix }}
    91    routePrefix: "{{ .Values.thanosRuler.thanosRulerSpec.routePrefix }}"
    92  {{- end }}
    93  {{- if .Values.thanosRuler.thanosRulerSpec.securityContext }}
    94    securityContext:
    95  {{ toYaml .Values.thanosRuler.thanosRulerSpec.securityContext | indent 4 }}
    96  {{- end }}
    97  {{- if .Values.thanosRuler.thanosRulerSpec.storage }}
    98    storage:
    99  {{ toYaml .Values.thanosRuler.thanosRulerSpec.storage | indent 4 }}
   100  {{- end }}
   101  {{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig }}
   102    objectStorageConfig:
   103  {{ toYaml .Values.thanosRuler.thanosRulerSpec.objectStorageConfig | indent 4 }}
   104  {{- end }}
   105  {{- if .Values.thanosRuler.thanosRulerSpec.labels }}
   106    labels:
   107  {{ toYaml .Values.thanosRuler.thanosRulerSpec.labels | indent 4 }}
   108  {{- end }}
   109  {{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfigFile }}
   110    objectStorageConfigFile: {{ .Values.thanosRuler.thanosRulerSpec.objectStorageConfigFile }}
   111  {{- end }}
   112  {{- if .Values.thanosRuler.thanosRulerSpec.podMetadata }}
   113    podMetadata:
   114  {{ toYaml .Values.thanosRuler.thanosRulerSpec.podMetadata | indent 4 }}
   115  {{- end }}
   116  {{- if or .Values.thanosRuler.thanosRulerSpec.podAntiAffinity .Values.thanosRuler.thanosRulerSpec.affinity }}
   117    affinity:
   118  {{- end }}
   119  {{- if .Values.thanosRuler.thanosRulerSpec.affinity }}
   120  {{ toYaml .Values.thanosRuler.thanosRulerSpec.affinity | indent 4 }}
   121  {{- end }}
   122  {{- if eq .Values.thanosRuler.thanosRulerSpec.podAntiAffinity "hard" }}
   123      podAntiAffinity:
   124        requiredDuringSchedulingIgnoredDuringExecution:
   125        - topologyKey: {{ .Values.thanosRuler.thanosRulerSpec.podAntiAffinityTopologyKey }}
   126          labelSelector:
   127            matchExpressions:
   128              - {key: app.kubernetes.io/name, operator: In, values: [thanos-ruler]}
   129              - {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.name" . }}]}
   130  {{- else if eq .Values.thanosRuler.thanosRulerSpec.podAntiAffinity "soft" }}
   131      podAntiAffinity:
   132        preferredDuringSchedulingIgnoredDuringExecution:
   133        - weight: 100
   134          podAffinityTerm:
   135            topologyKey: {{ .Values.thanosRuler.thanosRulerSpec.podAntiAffinityTopologyKey }}
   136            labelSelector:
   137              matchExpressions:
   138                - {key: app.kubernetes.io/name, operator: In, values: [thanos-ruler]}
   139                - {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.name" . }}]}
   140  {{- end }}
   141  {{- if .Values.thanosRuler.thanosRulerSpec.tolerations }}
   142    tolerations:
   143  {{ toYaml .Values.thanosRuler.thanosRulerSpec.tolerations | indent 4 }}
   144  {{- end }}
   145  {{- if .Values.thanosRuler.thanosRulerSpec.topologySpreadConstraints }}
   146    topologySpreadConstraints:
   147  {{ toYaml .Values.thanosRuler.thanosRulerSpec.topologySpreadConstraints | indent 4 }}
   148  {{- end }}
   149  {{- if .Values.global.imagePullSecrets }}
   150    imagePullSecrets:
   151  {{ toYaml .Values.global.imagePullSecrets | indent 4 }}
   152  {{- end }}
   153  {{- if .Values.thanosRuler.thanosRulerSpec.containers }}
   154    containers:
   155  {{ toYaml .Values.thanosRuler.thanosRulerSpec.containers | indent 4 }}
   156  {{- end }}
   157  {{- if .Values.thanosRuler.thanosRulerSpec.initContainers }}
   158    initContainers:
   159  {{ toYaml .Values.thanosRuler.thanosRulerSpec.initContainers | indent 4 }}
   160  {{- end }}
   161  {{- if .Values.thanosRuler.thanosRulerSpec.priorityClassName }}
   162    priorityClassName: {{.Values.thanosRuler.thanosRulerSpec.priorityClassName }}
   163  {{- end }}
   164  {{- if .Values.thanosRuler.thanosRulerSpec.volumes }}
   165    volumes:
   166  {{ toYaml .Values.thanosRuler.thanosRulerSpec.volumes | indent 4 }}
   167  {{- end }}
   168  {{- if .Values.thanosRuler.thanosRulerSpec.volumeMounts }}
   169    volumeMounts:
   170  {{ toYaml .Values.thanosRuler.thanosRulerSpec.volumeMounts | indent 4 }}
   171  {{- end }}
   172    portName: {{ .Values.thanosRuler.thanosRulerSpec.portName }}
   173  {{- end }}