Skip to content

Commit fb453d5

Browse files
author
Navfarm
committed
[PFMENG-2991] - Enable Option to Customize FluentBit Livess Probe and Readiness Probe
1 parent 3246d9f commit fb453d5

File tree

3 files changed

+45
-19
lines changed

3 files changed

+45
-19
lines changed

modules/essentials/fluent_bit.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ locals {
1515
service_account_name = local.service_account_name,
1616
image_repository = var.fluent_bit_image_repository,
1717
image_tag = var.fluent_bit_image_tag,
18+
liveness_probe = jsonencode(var.fluent_bit_liveness_probe),
19+
readiness_probe = jsonencode(var.fluent_bit_readiness_probe),
20+
resources = jsonencode(var.fluent_bit_resources),
1821
})
1922

2023
fluent_bit_helm_config = merge(
2124
local.default_helm_config,
2225
var.fluent_bit_helm_config
2326
)
24-
2527
}
2628

2729
#tfsec:ignore:aws-cloudwatch-log-group-customer-key Not using CMK to save cost

modules/essentials/templates/fluent_bit.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,11 @@ service:
3232
# prometheus.io/port: "2020"
3333
# prometheus.io/scrape: "true"
3434

35-
livenessProbe:
36-
httpGet:
37-
path: /
38-
port: http
39-
40-
readinessProbe:
41-
httpGet:
42-
path: /api/v1/health
43-
port: http
44-
45-
resources:
46-
limits:
47-
cpu: 100m
48-
memory: 128Mi
49-
requests:
50-
cpu: 100m
51-
memory: 128Mi
35+
livenessProbe: ${liveness_probe}
36+
37+
readinessProbe: ${readiness_probe}
38+
39+
resources: ${resources}
5240

5341
flush: 1
5442

@@ -71,7 +59,6 @@ config:
7159
Time_Key time
7260
Time_Format %d/%b/%Y:%H:%M:%S %z
7361
74-
7562
## https://docs.fluentbit.io/manual/pipeline/inputs
7663
inputs: |
7764
[INPUT]

modules/essentials/variables.tf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,43 @@ variable "fluent_bit_overwrite_helm_values" {
15051505
default = ""
15061506
}
15071507

1508+
variable "fluent_bit_liveness_probe" {
1509+
description = "Liveness probe for fluent-bit"
1510+
type = map(any)
1511+
default = {
1512+
httpGet = {
1513+
path = "/"
1514+
port = "2020"
1515+
}
1516+
}
1517+
}
1518+
1519+
variable "fluent_bit_readiness_probe" {
1520+
description = "Readiness probe for fluent-bit"
1521+
type = map(any)
1522+
default = {
1523+
httpGet = {
1524+
path = "/api/v1/health"
1525+
port = "2020"
1526+
}
1527+
}
1528+
}
1529+
1530+
variable "fluent_bit_resources" {
1531+
description = "Resources for fluent-bit"
1532+
type = map(any)
1533+
default = {
1534+
requests = {
1535+
cpu = "100m"
1536+
memory = "128Mi"
1537+
}
1538+
limits = {
1539+
cpu = "100m"
1540+
memory = "128Mi"
1541+
}
1542+
}
1543+
}
1544+
15081545
variable "ip_dual_stack_enabled" {
15091546
description = "Enable essentials to support EKS dual stack cluster"
15101547
type = bool

0 commit comments

Comments
 (0)