blob: 317339d7668f93ef63dc2c011dd11b9c5a079832 [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001---
2{{- if .Values.monitoring.selfMonitoring.enabled }}
3{{- with .Values.monitoring.selfMonitoring.podLogs }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -03004apiVersion: {{ .apiVersion }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00005kind: PodLogs
6metadata:
7 name: {{ include "loki.fullname" $ }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -03008 namespace: {{ $.Release.Namespace }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00009 {{- with .annotations }}
10 annotations:
11 {{- toYaml . | nindent 4 }}
12 {{- end }}
13 labels:
14 {{- include "loki.labels" $ | nindent 4 }}
15 {{- with .labels }}
16 {{- toYaml . | nindent 4 }}
17 {{- end }}
18spec:
19 pipelineStages:
20 - cri: { }
Giovanni Tirloni59219b62024-04-09 14:50:25 -030021 {{- with .additionalPipelineStages }}
22 {{- toYaml . | nindent 4 }}
23 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000024 relabelings:
Giovanni Tirloni59219b62024-04-09 14:50:25 -030025 - action: replace
26 sourceLabels:
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000027 - __meta_kubernetes_pod_node_name
28 targetLabel: __host__
29 - action: labelmap
30 regex: __meta_kubernetes_pod_label_(.+)
31 - action: replace
32 replacement: "$1"
33 separator: "-"
34 sourceLabels:
35 - __meta_kubernetes_pod_label_app_kubernetes_io_name
36 - __meta_kubernetes_pod_label_app_kubernetes_io_component
37 targetLabel: __service__
38 - action: replace
39 replacement: "$1"
40 separator: "/"
41 sourceLabels:
42 - __meta_kubernetes_namespace
43 - __service__
44 targetLabel: job
45 - action: replace
46 sourceLabels:
47 - __meta_kubernetes_pod_container_name
48 targetLabel: container
Giovanni Tirloni59219b62024-04-09 14:50:25 -030049 - action: replace
50 replacement: "{{ include "loki.clusterLabel" $ }}"
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000051 targetLabel: cluster
52 {{- with .relabelings }}
53 {{- toYaml . | nindent 4 }}
54 {{- end }}
55 namespaceSelector:
56 matchNames:
57 - {{ $.Release.Namespace }}
58 selector:
59 matchLabels:
60 {{- include "loki.selectorLabels" $ | nindent 6 }}
61{{- end }}
62{{- end }}