From 1d6a5395fec8614c79bdf1f05e7b7249f244bf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Furcan=20=C3=87aykara?= Date: Mon, 25 Dec 2023 16:37:22 +0300 Subject: [PATCH] add rancher logging bootstrapper logic, and control logic for karpenter provisioners --- aws-eks-addons/main.tf | 24 +++++++++++++++++++++--- aws-eks-addons/variables.tf | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/aws-eks-addons/main.tf b/aws-eks-addons/main.tf index 9be299a..3af58e5 100644 --- a/aws-eks-addons/main.tf +++ b/aws-eks-addons/main.tf @@ -477,6 +477,24 @@ resource "kubectl_manifest" "argocd_bootstrapper_application" { } } } + rancherLogging : { + enable: var.deploy_rancher_logging + values: { + fluentd: { + resources: { + limits: { + memory: var.rancher_logging_fluentd_memory_limit + cpu: var.rancher_logging_fluentd_cpu_limit + } + requests: { + memory: var.rancher_logging_fluentd_memory_request + cpu: var.rancher_logging_fluentd_cpu_request + } + } + + } + } + } }) } } @@ -593,7 +611,7 @@ resource "helm_release" "karpenter" { } resource "kubectl_manifest" "karpenter_stateful_provisioner" { - count = var.deploy_karpenter ? 1 : 0 + count = var.deploy_karpenter && var.deploy_karpenter_crds ? 1 : 0 yaml_body = yamlencode({ apiVersion: "karpenter.sh/v1alpha5" @@ -669,7 +687,7 @@ resource "kubectl_manifest" "karpenter_stateful_provisioner" { # there is no taint necessary for stateless applicatinos (system workloads will be scheduled at default eks node group(it will have system workload taint )) resource "kubectl_manifest" "karpenter_stateless_provisioner" { - count = var.deploy_karpenter ? 1 : 0 + count = var.deploy_karpenter && var.deploy_karpenter_crds ? 1 : 0 yaml_body = yamlencode({ apiVersion: "karpenter.sh/v1alpha5" @@ -728,7 +746,7 @@ resource "kubectl_manifest" "karpenter_stateless_provisioner" { } resource "kubectl_manifest" "karpenter_node_template" { - count = var.deploy_karpenter ? 1 : 0 + count = var.deploy_karpenter && var.deploy_karpenter_crds ? 1 : 0 yaml_body = <<-YAML apiVersion: karpenter.k8s.aws/v1alpha1 kind: AWSNodeTemplate diff --git a/aws-eks-addons/variables.tf b/aws-eks-addons/variables.tf index a2019a3..7982892 100644 --- a/aws-eks-addons/variables.tf +++ b/aws-eks-addons/variables.tf @@ -383,4 +383,37 @@ variable "karpenter_version" { variable "karpenter_windows_support" { default = false description = "Karpenter Windows Container Support" +} + +variable "deploy_rancher_logging" { + default = false + description = "value of the rancher logging" +} + +variable "rancher_logging_fluentd_memory_limit" { + default = "3000Mi" + description = "value of the rancher logging fluentd memory limit" +} + +variable "rancher_logging_fluentd_cpu_limit" { + default = "3000m" + description = "value of the rancher logging fluentd cpu limit" +} + + +variable "rancher_logging_fluentd_memory_request" { + default = "2000Mi" + description = "value of the rancher logging fluentd memory request" + +} + +variable "rancher_logging_fluentd_cpu_request" { + default = "2000m" + description = "value of the rancher logging fluentd cpu request" +} + + +variable "deploy_karpenter_crds" { + default = true + description = "deploy provisioners and node template" } \ No newline at end of file