Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 1 | {{- with .Values.monitoring.lokiCanary -}} |
| 2 | {{- if .enabled -}} |
| 3 | --- |
| 4 | apiVersion: apps/v1 |
| 5 | kind: DaemonSet |
| 6 | metadata: |
| 7 | name: {{ include "loki-canary.fullname" $ }} |
Giovanni Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 8 | namespace: {{ $.Release.Namespace }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 9 | labels: |
| 10 | {{- include "loki-canary.labels" $ | nindent 4 }} |
| 11 | spec: |
| 12 | selector: |
| 13 | matchLabels: |
| 14 | {{- include "loki-canary.selectorLabels" $ | nindent 6 }} |
Giovanni Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 15 | {{- with .updateStrategy }} |
| 16 | updateStrategy: |
| 17 | {{- toYaml . | nindent 4 }} |
| 18 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 19 | template: |
| 20 | metadata: |
Giovanni Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 21 | {{- with .annotations }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 22 | annotations: |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 23 | {{- toYaml . | nindent 8 }} |
Giovanni Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 24 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 25 | labels: |
| 26 | {{- include "loki-canary.selectorLabels" $ | nindent 8 }} |
Giovanni Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 27 | {{- with .podLabels }} |
| 28 | {{- toYaml . | nindent 8 }} |
| 29 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 30 | 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 Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 45 | - -labelname={{ .labelname }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 46 | - -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 Tirloni | 52306ad | 2024-04-12 15:35:05 -0300 | [diff] [blame] | 98 | {{- with .dnsConfig }} |
| 99 | dnsConfig: |
| 100 | {{- toYaml . | nindent 8 }} |
| 101 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 102 | {{- 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 }} |