Skip to content

Latest commit

 

History

History

cluster

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

terraform-eks-lens-cluster

This module creates the necessary IAM permissions for your EKS Lens workload to access the S3 bucket and push data into it. It also optionally deploys EKS Lens into the cluster and will onboard it to DoiT after creation. If deployments is enabled, it'll also offboard the cluster upon destruction.

Usage

module "<REGION>-<CLUSTER_NAME>" {
  source = "git::https://github.com/doitintl/terraform-eks-lens.git//cluster"

  cluster = {
    name             = "<CLUSTER_NAME>"
    deployment_id    = "<DEPLOYMENT_ID>"
    kube_state_image = "registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2" # make sure to use the latest available image
    otel_image       = "otel/opentelemetry-collector-contrib:0.83.0" # make sure to use the latest available image
  }
  # If running in EKS:
  cluster_oidc_issuer_url = "<CLUSTER_OIDC_ISSUER_URL>"
  # Alternatively, if managing your own cluster on EC2, set `cluster_oidc_issuer_url` to an empty string and uncomment the following:
  #ec2_cluster = true

  # By default, this module will also deploy the k8s manifests. Set to `false` if planning to deploy with another tool
  #deploy_manifests = false

  # If you need to set environment variables for the OpenTelemetry Collector, you can do so by setting the `otel_env` variable:
  # otel_env = {
  #   "GOMEMLIMIT"  = "2750MiB" # set the memory limit for the OpenTelemetry Collector
  # }

  # We recommend to read the OpenTelemetry Collector documentation to understand the memory limiter processor configuration: https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiterprocessor/README.md#best-practices

  # If you want to customize the memory limiter processor for the OpenTelemetry Collector, you can do so by setting the `otel_memory_limiter` variable:
  # otel_memory_limiter = {
  #   check_interval         = "1s"
  #   limit_percentage       = 70
  #   spike_limit_percentage = 30
  # }


  # If you want to customize the resources for the OpenTelemetry Collector container, you can do so by setting the `otel_resources` variable:
  # otel_resources = {
  #   requests = {
  #     cpu    = "100m"
  #     memory = "256Mi"
  #   }
  #   limits = {
  #     cpu    = "100m"
  #     memory = "256Mi"
  #   }
  # }

  # when configuring multiple providers for different clusters, you can configure the module to use to correct provider alias:
  providers = {
    kubernetes = kubernetes.<PROVIDER_ALIAS>
  }
}

Inputs

Name Description Type Default Required
cluster An object containing cluster configuration
object({
name = string
deployment_id = string
kube_state_image = string
otel_image = string
})
n/a yes
doit_webhook_url The base URL used for calling the DoiT webhook and registering/de-registering the cluster from EKS Lens string "https://console.doit.com/webhooks/v1/eks-metrics" no
cluster_oidc_issuer_url The OIDC Identity issuer URL for the EKS cluster string n/a yes
ec2_cluster Set to true if this is a self-managed k8s cluster running on EC2 (if so, you could also set cluster_oidc_issuer_url to an empty string) bool false no
deploy_manifests Set to false if you don't want this module to deploy EKS Lens into your cluster bool true no
otel_env Environment variables to set for the OpenTelemetry Collector map(string) {} no
otel_memory_limiter Configuration for the memory limiter processor
object({
check_interval = string
limit_percentage = number
spike_limit_percentage = number
})
{
"check_interval": "1s",
"limit_percentage": 70,
"spike_limit_percentage": 30
}
no
otel_resources Resources to set for the OpenTelemetry Collector container
object({
requests = object({
cpu = optional(string)
memory = optional(string)
})
limits = object({
cpu = optional(string)
memory = optional(string)
})
})
{}
no

Outputs

Name Description
account_id The ID of the used AWS account
region AWS region used
deployment_id Deployment ID as provided by DoiT
collector_deployment The Open Telemetry deployment name in the format of namespace/name
kube_state_metrics_deployment The kube-state-metrics deployment name in the format of namespace/name