blob: 250d1a8ade31e7b63369609c4d5ec02c62326c61 [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001{{- with .Values.monitoring.lokiCanary -}}
2{{- if .enabled -}}
3---
4apiVersion: apps/v1
5kind: DaemonSet
6metadata:
7 name: {{ include "loki-canary.fullname" $ }}
Giovanni Tirloni52306ad2024-04-12 15:35:05 -03008 namespace: {{ $.Release.Namespace }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00009 labels:
10 {{- include "loki-canary.labels" $ | nindent 4 }}
11spec:
12 selector:
13 matchLabels:
14 {{- include "loki-canary.selectorLabels" $ | nindent 6 }}
Giovanni Tirloni52306ad2024-04-12 15:35:05 -030015 {{- with .updateStrategy }}
16 updateStrategy:
17 {{- toYaml . | nindent 4 }}
18 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000019 template:
20 metadata:
Giovanni Tirloni52306ad2024-04-12 15:35:05 -030021 {{- with .annotations }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000022 annotations:
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000023 {{- toYaml . | nindent 8 }}
Giovanni Tirloni52306ad2024-04-12 15:35:05 -030024 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000025 labels:
26 {{- include "loki-canary.selectorLabels" $ | nindent 8 }}
Giovanni Tirloni52306ad2024-04-12 15:35:05 -030027 {{- with .podLabels }}
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000030 spec:
31 serviceAccountName: {{ include "loki-canary.fullname" $ }}
32 {{- with $.Values.imagePullSecrets }}
33 imagePullSecrets:
34 {{- toYaml . | nindent 8 }}
35 {{- end }}
36 {{- include "loki-canary.priorityClassName" $ | nindent 6 }}
37 securityContext:
38 {{- toYaml $.Values.loki.podSecurityContext | nindent 8 }}
39 containers:
40 - name: loki-canary
41 image: {{ include "loki-canary.image" $ }}
42 imagePullPolicy: {{ $.Values.loki.image.pullPolicy }}
43 args:
44 - -addr={{- include "loki.host" $ }}
Giovanni Tirloni52306ad2024-04-12 15:35:05 -030045 - -labelname={{ .labelname }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000046 - -labelvalue=$(POD_NAME)
47 {{- if $.Values.enterprise.enabled }}
48 - -user=$(USER)
49 - -tenant-id=$(USER)
50 - -pass=$(PASS)
51 {{- else if $.Values.loki.auth_enabled }}
52 - -user={{ $.Values.monitoring.selfMonitoring.tenant.name }}
53 - -tenant-id={{ $.Values.monitoring.selfMonitoring.tenant.name }}
54 {{- end }}
55 {{- with .extraArgs }}
56 {{- toYaml . | nindent 12 }}
57 {{- end }}
58 securityContext:
59 {{- toYaml $.Values.loki.containerSecurityContext | nindent 12 }}
60 ports:
61 - name: http-metrics
62 containerPort: 3500
63 protocol: TCP
64 env:
65 - name: POD_NAME
66 valueFrom:
67 fieldRef:
68 fieldPath: metadata.name
69 {{ if $.Values.enterprise.enabled }}
70 - name: USER
71 valueFrom:
72 secretKeyRef:
73 name: {{ include "enterprise-logs.selfMonitoringTenantSecret" $ }}
74 key: username
75 - name: PASS
76 valueFrom:
77 secretKeyRef:
78 name: {{ include "enterprise-logs.selfMonitoringTenantSecret" $ }}
79 key: password
80 {{- end -}}
81 {{- with .extraEnv }}
82 {{- toYaml . | nindent 12 }}
83 {{- end }}
84 {{- with .extraEnvFrom }}
85 envFrom:
86 {{- toYaml . | nindent 12 }}
87 {{- end }}
88 readinessProbe:
89 httpGet:
90 path: /metrics
91 port: http-metrics
92 initialDelaySeconds: 15
93 timeoutSeconds: 1
94 {{- with .resources}}
95 resources:
96 {{- toYaml . | nindent 12 }}
97 {{- end }}
Giovanni Tirloni52306ad2024-04-12 15:35:05 -030098 {{- with .dnsConfig }}
99 dnsConfig:
100 {{- toYaml . | nindent 8 }}
101 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +0000102 {{- with .nodeSelector }}
103 nodeSelector:
104 {{- toYaml . | nindent 8 }}
105 {{- end }}
106 {{- with .tolerations }}
107 tolerations:
108 {{- toYaml . | nindent 8 }}
109 {{- end }}
110{{- end }}
111{{- end }}