diff --git a/armonik/README.md b/armonik/README.md index f3fc6c950..9f9010b55 100644 --- a/armonik/README.md +++ b/armonik/README.md @@ -15,12 +15,12 @@ | Name | Version | |------|---------| -| [helm](#provider\_helm) | >= 2.10.1 | -| [kubernetes](#provider\_kubernetes) | >= 2.21.1 | -| [local](#provider\_local) | >= 2.1.0 | -| [pkcs12](#provider\_pkcs12) | >= 0.0.7 | -| [random](#provider\_random) | >= 3.5.1 | -| [tls](#provider\_tls) | >= 4.0.4 | +| [helm](#provider\_helm) | 2.12.1 | +| [kubernetes](#provider\_kubernetes) | 2.26.0 | +| [local](#provider\_local) | 2.4.1 | +| [pkcs12](#provider\_pkcs12) | 0.2.5 | +| [random](#provider\_random) | 3.6.0 | +| [tls](#provider\_tls) | 4.0.5 | ## Modules diff --git a/armonik/compute-plane.tf b/armonik/compute-plane.tf index 897101609..f04e222e8 100644 --- a/armonik/compute-plane.tf +++ b/armonik/compute-plane.tf @@ -453,7 +453,7 @@ resource "kubernetes_deployment" "compute_plane" { command = ["powershell", "-ExecutionPolicy", "Bypass", "-File", "C:/fluent-bit/entrypoint.ps1"] env_from { config_map_ref { - name = var.fluent_bit.windows_configmaps.envvars + name = try(var.fluent_bit.windows_configmaps.envvars, "") } } # Please don't change below read-only permissions diff --git a/armonik/control-plane.tf b/armonik/control-plane.tf index 29c7e2738..a1f0e2e8c 100644 --- a/armonik/control-plane.tf +++ b/armonik/control-plane.tf @@ -246,7 +246,7 @@ resource "kubernetes_deployment" "control_plane" { command = ["powershell", "-ExecutionPolicy", "Bypass", "-File", "C:/fluent-bit/entrypoint.ps1"] env_from { config_map_ref { - name = var.fluent_bit.windows_configmaps.envvars + name = try(var.fluent_bit.windows_configmaps.envvars, "") } } # Please don't change below read-only permissions diff --git a/armonik/locals.tf b/armonik/locals.tf index 88fcb210b..162a898d6 100644 --- a/armonik/locals.tf +++ b/armonik/locals.tf @@ -59,6 +59,11 @@ locals { # Fluent-bit volumes # Please don't change below read-only permissions fluent_bit_volumes = { + fluentbitstate = { + mount_path = "/var/fluent-bit/state" + read_only = false + type = "host_path" + } varlog = { mount_path = "/var/log" read_only = true @@ -86,7 +91,8 @@ locals { } } # Fluent-bit volumes windows - fluent_bit_windows_volumes = { + fluent_bit_windows_volumes = !var.fluent_bit.windows_is_daemonset ? local.volumes_info : {} + volumes_info = { windowsfluentbitstate = { mount_path = "C:\\var\\fluent-bit\\state" read_only = false diff --git a/monitoring/onpremise/fluent-bit/README.md b/monitoring/onpremise/fluent-bit/README.md index a87aaab05..a295c06da 100644 --- a/monitoring/onpremise/fluent-bit/README.md +++ b/monitoring/onpremise/fluent-bit/README.md @@ -10,7 +10,7 @@ | Name | Version | |------|---------| -| [kubernetes](#provider\_kubernetes) | >= 2.21.1 | +| [kubernetes](#provider\_kubernetes) | 2.34.0 | ## Modules @@ -42,7 +42,7 @@ No modules. | [aws](#input\_aws) | AWS user for logs, prefer to pass them through env('AWS\_*') in your parameters.tfvars |
object({
aws_secret_access_key = optional(string, "")
aws_access_id = optional(string, "")
aws_session_token = optional(string, "")
})
| `{}` | no | | [cloudwatch](#input\_cloudwatch) | CloudWatch info | `any` | `{}` | no | | [fluent\_bit](#input\_fluent\_bit) | Parameters of Fluent bit |
object({
container_name = string
image = string
tag = string
is_daemonset = bool
http_server = string
http_port = string
read_from_head = string
read_from_tail = string
image_pull_secrets = string
parser = string
fluent_bit_state_hostpath = string # path = "/var/log/fluent-bit/state" for GCP Autopilot | path = "/var/fluent-bit/state" for localhost, AWS EKS, GCP GKE
var_lib_docker_containers_hostpath = string # path = "/var/log/lib/docker/containers" for GCP Autopilot | path = "/var/lib/docker/containers" for localhost, AWS EKS, GCP GKE
run_log_journal_hostpath = string # path = "/var/log/run/log/journal" -for GCP Autopilot | path = "/run/log/journal" for localhost, AWS EKS, GCP GKE
})
| n/a | yes | -| [fluent\_bit\_windows](#input\_fluent\_bit\_windows) | Parameters of Fluent bit for windows |
object({
container_name = string
image = string
tag = string
is_daemonset = bool
http_server = string
http_port = string
read_from_head = string
read_from_tail = string
image_pull_secrets = string
parser = string
fluent_bit_state_hostpath = string
var_lib_docker_containers_hostpath = string
run_log_journal_hostpath = string
})
| n/a | yes | +| [fluent\_bit\_windows](#input\_fluent\_bit\_windows) | Parameters of Fluent bit for windows |
object({
container_name = optional(string)
image = optional(string)
tag = optional(string)
is_daemonset = optional(bool)
http_server = optional(string)
http_port = optional(string)
read_from_head = optional(string)
read_from_tail = optional(string)
image_pull_secrets = optional(string)
parser = optional(string)
fluent_bit_state_hostpath = optional(string)
var_lib_docker_containers_hostpath = optional(string)
run_log_journal_hostpath = optional(string)
})
| `null` | no | | [namespace](#input\_namespace) | Namespace of ArmoniK monitoring | `string` | n/a | yes | | [node\_selector](#input\_node\_selector) | Node selector for fluent-bit on linux | `any` | `{}` | no | | [node\_selector\_windows](#input\_node\_selector\_windows) | Node selector for fluent-bit on windows | `any` | `{}` | no | diff --git a/monitoring/onpremise/fluent-bit/locals.tf b/monitoring/onpremise/fluent-bit/locals.tf index 0b427511c..83dc9fb57 100644 --- a/monitoring/onpremise/fluent-bit/locals.tf +++ b/monitoring/onpremise/fluent-bit/locals.tf @@ -33,7 +33,7 @@ locals { fluent_bit_windows_image = try(var.fluent_bit_windows.image, "fluent/fluent-bit") fluent_bit_windows_tag = try(var.fluent_bit_windows.tag, "windows-2022-3.2.0") fluent_bit_windows_is_daemonset = tobool(try(var.fluent_bit_windows.is_daemonset, false)) - fluent_bit_windows_parser = try(var.fluent_bit_windows.parser) + fluent_bit_windows_parser = try(var.fluent_bit_windows.parser, "") fluent_bit_windows_http_server = try(var.fluent_bit_windows.http_server, "Off") fluent_bit_windows_http_port = try(var.fluent_bit_windows.http_port, "") fluent_bit_windows_read_from_head = try(var.fluent_bit_windows.read_from_head, "On") diff --git a/monitoring/onpremise/fluent-bit/outputs.tf b/monitoring/onpremise/fluent-bit/outputs.tf index efbe17409..5eaa65e28 100644 --- a/monitoring/onpremise/fluent-bit/outputs.tf +++ b/monitoring/onpremise/fluent-bit/outputs.tf @@ -28,29 +28,29 @@ output "configmaps" { output "windows_container_name" { description = "Container name of Fluent-bit" - value = var.fluent_bit_windows.container_name + value = var.fluent_bit_windows != null ? var.fluent_bit_windows.container_name : "" } output "windows_image" { description = "image of Fluent-bit" - value = var.fluent_bit_windows.image + value = var.fluent_bit_windows != null ? var.fluent_bit_windows.image : "" } output "windows_tag" { description = "tag of Fluent-bit" - value = var.fluent_bit_windows.tag + value = var.fluent_bit_windows != null ? var.fluent_bit_windows.tag : "" } output "windows_is_daemonset" { description = "Is Fluent-bit a daemonset" - value = var.fluent_bit_windows.is_daemonset + value = var.fluent_bit_windows != null ? var.fluent_bit_windows.is_daemonset : true } output "windows_configmaps" { description = "Configmaps of Fluent-bit" value = { - envvars = kubernetes_config_map.fluent_bit_envvars_config_windows[0].metadata[0].name - config = kubernetes_config_map.fluent_bit_config_windows[0].metadata[0].name - entry = kubernetes_config_map.fluent_bit_entrypoint[0].metadata[0].name + envvars = var.fluent_bit_windows != null ? kubernetes_config_map.fluent_bit_envvars_config_windows[0].metadata[0].name : "" + config = var.fluent_bit_windows != null ? kubernetes_config_map.fluent_bit_config_windows[0].metadata[0].name : "" + entry = var.fluent_bit_windows != null ? kubernetes_config_map.fluent_bit_entrypoint[0].metadata[0].name : "" } } diff --git a/monitoring/onpremise/fluent-bit/variables.tf b/monitoring/onpremise/fluent-bit/variables.tf index 29dd19c8f..bb87ad762 100644 --- a/monitoring/onpremise/fluent-bit/variables.tf +++ b/monitoring/onpremise/fluent-bit/variables.tf @@ -74,22 +74,19 @@ variable "fluent_bit" { variable "fluent_bit_windows" { description = "Parameters of Fluent bit for windows" type = object({ - container_name = string - image = string - tag = string - is_daemonset = bool - http_server = string - http_port = string - read_from_head = string - read_from_tail = string - image_pull_secrets = string - parser = string - fluent_bit_state_hostpath = string - var_lib_docker_containers_hostpath = string - run_log_journal_hostpath = string + container_name = optional(string) + image = optional(string) + tag = optional(string) + is_daemonset = optional(bool) + http_server = optional(string) + http_port = optional(string) + read_from_head = optional(string) + read_from_tail = optional(string) + image_pull_secrets = optional(string) + parser = optional(string) + fluent_bit_state_hostpath = optional(string) + var_lib_docker_containers_hostpath = optional(string) + run_log_journal_hostpath = optional(string) }) - validation { - condition = contains(["apache", "apache2", "apache_error", "nginx", "json", "docker", "cri", "syslog"], var.fluent_bit_windows.parser) - error_message = "Valid values for Fluent-bit parsers are: \"apache\" | \"apache2\" | \"apache_error\" | \"nginx\" | \"json\" | \"docker\" | \"cri\" | \"syslog\"." - } + default = null }