blob: dc5c6296891c78a865cd588968b9a083d2cd5b64 [file] [log] [blame]
Mohammed Naser65cda132024-05-02 14:34:08 -04001{{- with .Values.lokiCanary -}}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00002{{- if .enabled -}}
3---
4apiVersion: apps/v1
5kind: DaemonSet
6metadata:
7 name: {{ include "loki-canary.fullname" $ }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -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 Tirloni59219b62024-04-09 14:50:25 -030015 {{- with .updateStrategy }}
16 updateStrategy:
17 {{- toYaml . | nindent 4 }}
18 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000019 template:
20 metadata:
Giovanni Tirloni59219b62024-04-09 14:50:25 -030021 {{- with .annotations }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000022 annotations:
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000023 {{- toYaml . | nindent 8 }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030024 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000025 labels:
26 {{- include "loki-canary.selectorLabels" $ | nindent 8 }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -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 Tirloni59219b62024-04-09 14:50:25 -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 }}
Mohammed Naser65cda132024-05-02 14:34:08 -040054 - -pass={{ $.Values.monitoring.selfMonitoring.tenant.password }}
55 {{- end }}
56 {{- if .push }}
57 - -push=true
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000058 {{- end }}
59 {{- with .extraArgs }}
60 {{- toYaml . | nindent 12 }}
61 {{- end }}
62 securityContext:
63 {{- toYaml $.Values.loki.containerSecurityContext | nindent 12 }}
Mohammed Naser65cda132024-05-02 14:34:08 -040064 volumeMounts:
65 {{- with $.Values.lokiCanary.extraVolumeMounts }}
66 {{- toYaml . | nindent 12 }}
67 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000068 ports:
69 - name: http-metrics
70 containerPort: 3500
71 protocol: TCP
72 env:
73 - name: POD_NAME
74 valueFrom:
75 fieldRef:
76 fieldPath: metadata.name
77 {{ if $.Values.enterprise.enabled }}
78 - name: USER
79 valueFrom:
80 secretKeyRef:
81 name: {{ include "enterprise-logs.selfMonitoringTenantSecret" $ }}
82 key: username
83 - name: PASS
84 valueFrom:
85 secretKeyRef:
86 name: {{ include "enterprise-logs.selfMonitoringTenantSecret" $ }}
87 key: password
88 {{- end -}}
89 {{- with .extraEnv }}
90 {{- toYaml . | nindent 12 }}
91 {{- end }}
92 {{- with .extraEnvFrom }}
93 envFrom:
94 {{- toYaml . | nindent 12 }}
95 {{- end }}
96 readinessProbe:
97 httpGet:
98 path: /metrics
99 port: http-metrics
100 initialDelaySeconds: 15
101 timeoutSeconds: 1
102 {{- with .resources}}
103 resources:
104 {{- toYaml . | nindent 12 }}
105 {{- end }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -0300106 {{- with .dnsConfig }}
107 dnsConfig:
108 {{- toYaml . | nindent 8 }}
109 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +0000110 {{- with .nodeSelector }}
111 nodeSelector:
112 {{- toYaml . | nindent 8 }}
113 {{- end }}
114 {{- with .tolerations }}
115 tolerations:
116 {{- toYaml . | nindent 8 }}
117 {{- end }}
Mohammed Naser65cda132024-05-02 14:34:08 -0400118 volumes:
119 {{- with $.Values.lokiCanary.extraVolumes }}
120 {{- toYaml . | nindent 8 }}
121 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +0000122{{- end }}
123{{- end }}