Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 1 | {{- with .Values.lokiCanary -}} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 2 | {{- if .enabled -}} |
| 3 | --- |
| 4 | apiVersion: apps/v1 |
| 5 | kind: DaemonSet |
| 6 | metadata: |
| 7 | name: {{ include "loki-canary.fullname" $ }} |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -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 | 59219b6 | 2024-04-09 14:50:25 -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 | 59219b6 | 2024-04-09 14:50:25 -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 | 59219b6 | 2024-04-09 14:50:25 -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 | 59219b6 | 2024-04-09 14:50:25 -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 | 59219b6 | 2024-04-09 14:50:25 -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 }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 54 | - -pass={{ $.Values.monitoring.selfMonitoring.tenant.password }} |
| 55 | {{- end }} |
| 56 | {{- if .push }} |
| 57 | - -push=true |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 58 | {{- end }} |
| 59 | {{- with .extraArgs }} |
| 60 | {{- toYaml . | nindent 12 }} |
| 61 | {{- end }} |
| 62 | securityContext: |
| 63 | {{- toYaml $.Values.loki.containerSecurityContext | nindent 12 }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 64 | volumeMounts: |
| 65 | {{- with $.Values.lokiCanary.extraVolumeMounts }} |
| 66 | {{- toYaml . | nindent 12 }} |
| 67 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 68 | 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 Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 106 | {{- with .dnsConfig }} |
| 107 | dnsConfig: |
| 108 | {{- toYaml . | nindent 8 }} |
| 109 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 110 | {{- with .nodeSelector }} |
| 111 | nodeSelector: |
| 112 | {{- toYaml . | nindent 8 }} |
| 113 | {{- end }} |
| 114 | {{- with .tolerations }} |
| 115 | tolerations: |
| 116 | {{- toYaml . | nindent 8 }} |
| 117 | {{- end }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 118 | volumes: |
| 119 | {{- with $.Values.lokiCanary.extraVolumes }} |
| 120 | {{- toYaml . | nindent 8 }} |
| 121 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 122 | {{- end }} |
| 123 | {{- end }} |