values.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. # -- Overrides the chart's name
  2. nameOverride: null
  3. # -- Overrides the chart's computed fullname
  4. fullnameOverride: null
  5. daemonset:
  6. # -- Deploys Promtail as a DaemonSet
  7. enabled: true
  8. deployment:
  9. # -- Deploys Promtail as a Deployment
  10. enabled: false
  11. replicaCount: 1
  12. autoscaling:
  13. # -- Creates a HorizontalPodAutoscaler for the deployment
  14. enabled: false
  15. minReplicas: 1
  16. maxReplicas: 10
  17. targetCPUUtilizationPercentage: 80
  18. targetMemoryUtilizationPercentage:
  19. secret:
  20. # -- Labels for the Secret
  21. labels: {}
  22. # -- Annotations for the Secret
  23. annotations: {}
  24. configmap:
  25. # -- If enabled, promtail config will be created as a ConfigMap instead of a secret
  26. enabled: false
  27. initContainer: []
  28. # # -- Specifies whether the init container for setting inotify max user instances is to be enabled
  29. # - name: init
  30. # # -- Docker registry, image and tag for the init container image
  31. # image: docker.io/busybox:1.33
  32. # # -- Docker image pull policy for the init container image
  33. # imagePullPolicy: IfNotPresent
  34. # # -- The inotify max user instances to configure
  35. # command:
  36. # - sh
  37. # - -c
  38. # - sysctl -w fs.inotify.max_user_instances=128
  39. # securityContext:
  40. # privileged: true
  41. image:
  42. # -- The Docker registry
  43. registry: docker.io
  44. # -- Docker image repository
  45. repository: grafana/promtail
  46. # -- Overrides the image tag whose default is the chart's appVersion
  47. tag: null
  48. # -- Docker image pull policy
  49. pullPolicy: IfNotPresent
  50. # -- Image pull secrets for Docker images
  51. imagePullSecrets: []
  52. # -- Annotations for the DaemonSet
  53. annotations: {}
  54. # -- The update strategy for the DaemonSet
  55. updateStrategy: {}
  56. # -- Pod labels
  57. podLabels: {}
  58. # -- Pod annotations
  59. podAnnotations: {}
  60. # prometheus.io/scrape: "true"
  61. # prometheus.io/port: "http-metrics"
  62. # -- The name of the PriorityClass
  63. priorityClassName: null
  64. # -- Liveness probe
  65. livenessProbe: {}
  66. # -- Readiness probe
  67. # @default -- See `values.yaml`
  68. readinessProbe:
  69. failureThreshold: 5
  70. httpGet:
  71. path: "{{ printf `%s/ready` .Values.httpPathPrefix }}"
  72. port: http-metrics
  73. initialDelaySeconds: 10
  74. periodSeconds: 10
  75. successThreshold: 1
  76. timeoutSeconds: 1
  77. # -- Resource requests and limits
  78. resources: {}
  79. # limits:
  80. # cpu: 200m
  81. # memory: 128Mi
  82. # requests:
  83. # cpu: 100m
  84. # memory: 128Mi
  85. # -- The security context for pods
  86. podSecurityContext:
  87. runAsUser: 0
  88. runAsGroup: 0
  89. # -- The security context for containers
  90. containerSecurityContext:
  91. readOnlyRootFilesystem: true
  92. capabilities:
  93. drop:
  94. - ALL
  95. allowPrivilegeEscalation: false
  96. rbac:
  97. # -- Specifies whether RBAC resources are to be created
  98. create: true
  99. # -- Specifies whether a PodSecurityPolicy is to be created
  100. pspEnabled: false
  101. # -- The name of the Namespace to deploy
  102. # If not set, `.Release.Namespace` is used
  103. namespace: null
  104. serviceAccount:
  105. # -- Specifies whether a ServiceAccount should be created
  106. create: true
  107. # -- The name of the ServiceAccount to use.
  108. # If not set and `create` is true, a name is generated using the fullname template
  109. name: null
  110. # -- Image pull secrets for the service account
  111. imagePullSecrets: []
  112. # -- Annotations for the service account
  113. annotations: {}
  114. # -- Node selector for pods
  115. nodeSelector: {}
  116. # -- Affinity configuration for pods
  117. affinity: {}
  118. # -- Tolerations for pods. By default, pods will be scheduled on master/control-plane nodes.
  119. tolerations:
  120. - key: node-role.kubernetes.io/master
  121. operator: Exists
  122. effect: NoSchedule
  123. - key: node-role.kubernetes.io/control-plane
  124. operator: Exists
  125. effect: NoSchedule
  126. # -- Default volumes that are mounted into pods. In most cases, these should not be changed.
  127. # Use `extraVolumes`/`extraVolumeMounts` for additional custom volumes.
  128. # @default -- See `values.yaml`
  129. defaultVolumes:
  130. - name: run
  131. hostPath:
  132. path: /run/promtail
  133. - name: containers
  134. hostPath:
  135. path: /var/lib/docker/containers
  136. - name: pods
  137. hostPath:
  138. path: /var/log/pods
  139. # -- Default volume mounts. Corresponds to `volumes`.
  140. # @default -- See `values.yaml`
  141. defaultVolumeMounts:
  142. - name: run
  143. mountPath: /run/promtail
  144. - name: containers
  145. mountPath: /var/lib/docker/containers
  146. readOnly: true
  147. - name: pods
  148. mountPath: /var/log/pods
  149. readOnly: true
  150. # Extra volumes to be added in addition to those specified under `defaultVolumes`.
  151. extraVolumes: []
  152. # Extra volume mounts together. Corresponds to `extraVolumes`.
  153. extraVolumeMounts: []
  154. # Extra args for the Promtail container.
  155. extraArgs: []
  156. # -- Example:
  157. # -- extraArgs:
  158. # -- - -client.external-labels=hostname=$(HOSTNAME)
  159. # -- Extra environment variables
  160. extraEnv: []
  161. # -- Extra environment variables from secrets or configmaps
  162. extraEnvFrom: []
  163. # -- Configure enableServiceLinks in pod
  164. enableServiceLinks: true
  165. # ServiceMonitor configuration
  166. serviceMonitor:
  167. # -- If enabled, ServiceMonitor resources for Prometheus Operator are created
  168. enabled: false
  169. # -- Alternative namespace for ServiceMonitor resources
  170. namespace: null
  171. # -- Namespace selector for ServiceMonitor resources
  172. namespaceSelector: {}
  173. # -- ServiceMonitor annotations
  174. annotations: {}
  175. # -- Additional ServiceMonitor labels
  176. labels: {}
  177. # -- ServiceMonitor scrape interval
  178. interval: null
  179. # -- ServiceMonitor scrape timeout in Go duration format (e.g. 15s)
  180. scrapeTimeout: null
  181. # -- ServiceMonitor relabel configs to apply to samples before scraping
  182. # https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
  183. # (defines `relabel_configs`)
  184. relabelings: []
  185. # -- ServiceMonitor relabel configs to apply to samples as the last
  186. # step before ingestion
  187. # https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
  188. # (defines `metric_relabel_configs`)
  189. metricRelabelings: []
  190. # --ServiceMonitor will add labels from the service to the Prometheus metric
  191. # https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec
  192. targetLabels: []
  193. # -- ServiceMonitor will use http by default, but you can pick https as well
  194. scheme: http
  195. # -- ServiceMonitor will use these tlsConfig settings to make the health check requests
  196. tlsConfig: null
  197. # -- Prometheus rules will be deployed for alerting purposes
  198. prometheusRule:
  199. enabled: false
  200. additionalLabels: {}
  201. # namespace:
  202. rules: []
  203. # - alert: PromtailRequestErrors
  204. # expr: 100 * sum(rate(promtail_request_duration_seconds_count{status_code=~"5..|failed"}[1m])) by (namespace, job, route, instance) / sum(rate(promtail_request_duration_seconds_count[1m])) by (namespace, job, route, instance) > 10
  205. # for: 5m
  206. # labels:
  207. # severity: critical
  208. # annotations:
  209. # description: |
  210. # The {{ $labels.job }} {{ $labels.route }} is experiencing
  211. # {{ printf \"%.2f\" $value }} errors.
  212. # VALUE = {{ $value }}
  213. # LABELS = {{ $labels }}
  214. # summary: Promtail request errors (instance {{ $labels.instance }})
  215. # - alert: PromtailRequestLatency
  216. # expr: histogram_quantile(0.99, sum(rate(promtail_request_duration_seconds_bucket[5m])) by (le)) > 1
  217. # for: 5m
  218. # labels:
  219. # severity: critical
  220. # annotations:
  221. # summary: Promtail request latency (instance {{ $labels.instance }})
  222. # description: |
  223. # The {{ $labels.job }} {{ $labels.route }} is experiencing
  224. # {{ printf \"%.2f\" $value }}s 99th percentile latency.
  225. # VALUE = {{ $value }}
  226. # LABELS = {{ $labels }}
  227. # Extra containers created as part of a Promtail Deployment resource
  228. # - spec for Container:
  229. # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core
  230. #
  231. # Note that the key is used as the `name` field, i.e. below will create a
  232. # container named `promtail-proxy`.
  233. extraContainers: {}
  234. # promtail-proxy:
  235. # image: nginx
  236. # ...
  237. # -- Configure additional ports and services. For each configured port, a corresponding service is created.
  238. # See values.yaml for details
  239. extraPorts: {}
  240. # syslog:
  241. # name: tcp-syslog
  242. # containerPort: 1514
  243. # protocol: TCP
  244. # service:
  245. # type: ClusterIP
  246. # clusterIP: null
  247. # port: 1514
  248. # externalIPs: []
  249. # nodePort: null
  250. # annotations: {}
  251. # labels: {}
  252. # loadBalancerIP: null
  253. # loadBalancerSourceRanges: []
  254. # externalTrafficPolicy: null
  255. # -- PodSecurityPolicy configuration.
  256. # @default -- See `values.yaml`
  257. podSecurityPolicy:
  258. privileged: true
  259. allowPrivilegeEscalation: true
  260. volumes:
  261. - 'secret'
  262. - 'hostPath'
  263. - 'downwardAPI'
  264. hostNetwork: false
  265. hostIPC: false
  266. hostPID: false
  267. runAsUser:
  268. rule: 'RunAsAny'
  269. seLinux:
  270. rule: 'RunAsAny'
  271. supplementalGroups:
  272. rule: 'RunAsAny'
  273. fsGroup:
  274. rule: 'RunAsAny'
  275. readOnlyRootFilesystem: true
  276. requiredDropCapabilities:
  277. - ALL
  278. # -- Section for crafting Promtails config file. The only directly relevant value is `config.file`
  279. # which is a templated string that references the other values and snippets below this key.
  280. # @default -- See `values.yaml`
  281. config:
  282. # -- The log level of the Promtail server
  283. # Must be reference in `config.file` to configure `server.log_level`
  284. # See default config in `values.yaml`
  285. logLevel: info
  286. # -- The port of the Promtail server
  287. # Must be reference in `config.file` to configure `server.http_listen_port`
  288. # See default config in `values.yaml`
  289. serverPort: 3101
  290. # -- The config of clients of the Promtail server
  291. # Must be reference in `config.file` to configure `clients`
  292. # @default -- See `values.yaml`
  293. clients:
  294. - url: http://loki-gateway/loki/api/v1/push
  295. # -- A section of reusable snippets that can be reference in `config.file`.
  296. # Custom snippets may be added in order to reduce redundancy.
  297. # This is especially helpful when multiple `kubernetes_sd_configs` are use which usually have large parts in common.
  298. # @default -- See `values.yaml`
  299. snippets:
  300. pipelineStages:
  301. - cri: {}
  302. common:
  303. - action: replace
  304. source_labels:
  305. - __meta_kubernetes_pod_node_name
  306. target_label: node_name
  307. - action: replace
  308. source_labels:
  309. - __meta_kubernetes_namespace
  310. target_label: namespace
  311. - action: replace
  312. replacement: $1
  313. separator: /
  314. source_labels:
  315. - namespace
  316. - app
  317. target_label: job
  318. - action: replace
  319. source_labels:
  320. - __meta_kubernetes_pod_name
  321. target_label: pod
  322. - action: replace
  323. source_labels:
  324. - __meta_kubernetes_pod_container_name
  325. target_label: container
  326. - action: replace
  327. replacement: /var/log/pods/*$1/*.log
  328. separator: /
  329. source_labels:
  330. - __meta_kubernetes_pod_uid
  331. - __meta_kubernetes_pod_container_name
  332. target_label: __path__
  333. - action: replace
  334. replacement: /var/log/pods/*$1/*.log
  335. regex: true/(.*)
  336. separator: /
  337. source_labels:
  338. - __meta_kubernetes_pod_annotationpresent_kubernetes_io_config_hash
  339. - __meta_kubernetes_pod_annotation_kubernetes_io_config_hash
  340. - __meta_kubernetes_pod_container_name
  341. target_label: __path__
  342. # If set to true, adds an additional label for the scrape job.
  343. # This helps debug the Promtail config.
  344. addScrapeJobLabel: false
  345. # -- You can put here any keys that will be directly added to the config file's 'limits_config' block.
  346. # @default -- empty
  347. extraLimitsConfig: ""
  348. # -- You can put here any keys that will be directly added to the config file's 'server' block.
  349. # @default -- empty
  350. extraServerConfigs: ""
  351. # -- You can put here any additional scrape configs you want to add to the config file.
  352. # @default -- empty
  353. extraScrapeConfigs: ""
  354. # -- You can put here any additional relabel_configs to "kubernetes-pods" job
  355. extraRelabelConfigs: []
  356. scrapeConfigs: |
  357. # See also https://github.com/grafana/loki/blob/master/production/ksonnet/promtail/scrape_config.libsonnet for reference
  358. - job_name: kubernetes-pods
  359. pipeline_stages:
  360. {{- toYaml .Values.config.snippets.pipelineStages | nindent 4 }}
  361. kubernetes_sd_configs:
  362. - role: pod
  363. relabel_configs:
  364. - source_labels:
  365. - __meta_kubernetes_pod_controller_name
  366. regex: ([0-9a-z-.]+?)(-[0-9a-f]{8,10})?
  367. action: replace
  368. target_label: __tmp_controller_name
  369. - source_labels:
  370. - __meta_kubernetes_pod_label_app_kubernetes_io_name
  371. - __meta_kubernetes_pod_label_app
  372. - __tmp_controller_name
  373. - __meta_kubernetes_pod_name
  374. regex: ^;*([^;]+)(;.*)?$
  375. action: replace
  376. target_label: app
  377. - source_labels:
  378. - __meta_kubernetes_pod_label_app_kubernetes_io_instance
  379. - __meta_kubernetes_pod_label_release
  380. regex: ^;*([^;]+)(;.*)?$
  381. action: replace
  382. target_label: instance
  383. - source_labels:
  384. - __meta_kubernetes_pod_label_app_kubernetes_io_component
  385. - __meta_kubernetes_pod_label_component
  386. regex: ^;*([^;]+)(;.*)?$
  387. action: replace
  388. target_label: component
  389. {{- if .Values.config.snippets.addScrapeJobLabel }}
  390. - replacement: kubernetes-pods
  391. target_label: scrape_job
  392. {{- end }}
  393. {{- toYaml .Values.config.snippets.common | nindent 4 }}
  394. {{- with .Values.config.snippets.extraRelabelConfigs }}
  395. {{- toYaml . | nindent 4 }}
  396. {{- end }}
  397. # -- Config file contents for Promtail.
  398. # Must be configured as string.
  399. # It is templated so it can be assembled from reusable snippets in order to avoid redundancy.
  400. # @default -- See `values.yaml`
  401. file: |
  402. server:
  403. log_level: {{ .Values.config.logLevel }}
  404. http_listen_port: {{ .Values.config.serverPort }}
  405. {{- with .Values.httpPathPrefix }}
  406. http_path_prefix: {{ . }}
  407. {{- end }}
  408. {{- tpl .Values.config.snippets.extraServerConfigs . | nindent 2 }}
  409. clients:
  410. {{- tpl (toYaml .Values.config.clients) . | nindent 2 }}
  411. positions:
  412. filename: /run/promtail/positions.yaml
  413. scrape_configs:
  414. {{- tpl .Values.config.snippets.scrapeConfigs . | nindent 2 }}
  415. {{- tpl .Values.config.snippets.extraScrapeConfigs . | nindent 2 }}
  416. limits_config:
  417. {{- tpl .Values.config.snippets.extraLimitsConfig . | nindent 2 }}
  418. networkPolicy:
  419. # -- Specifies whether Network Policies should be created
  420. enabled: false
  421. metrics:
  422. # -- Specifies the Pods which are allowed to access the metrics port.
  423. # As this is cross-namespace communication, you also neeed the namespaceSelector.
  424. podSelector: {}
  425. # -- Specifies the namespaces which are allowed to access the metrics port
  426. namespaceSelector: {}
  427. # -- Specifies specific network CIDRs which are allowed to access the metrics port.
  428. # In case you use namespaceSelector, you also have to specify your kubelet networks here.
  429. # The metrics ports are also used for probes.
  430. cidrs: []
  431. k8sApi:
  432. # -- Specify the k8s API endpoint port
  433. port: 8443
  434. # -- Specifies specific network CIDRs you want to limit access to
  435. cidrs: []
  436. # -- Base path to server all API routes fro
  437. httpPathPrefix: ""
  438. # -- Extra K8s manifests to deploy
  439. extraObjects: []
  440. # - apiVersion: "kubernetes-client.io/v1"
  441. # kind: ExternalSecret
  442. # metadata:
  443. # name: promtail-secrets
  444. # spec:
  445. # backendType: gcpSecretsManager
  446. # data:
  447. # - key: promtail-oauth2-creds
  448. # name: client_secret