DEV Community

Set custom configuration in AWS EKS CoreDNS Addon

When you enable managed addons in EKS, they come with predefined configurations. Nevertheless, there are situations where we have to override them. This gist shows how to set custom configuration for the CoreDNS addon using terraform-aws-modules/terraform-aws-eks and via the AWS console.

...
addons = {
    coredns = {
      addon_version = "v1.11.4-eksbuild.2"
      most_recent   = true
      configuration_values = <<EOT
      {
        "corefile": ".:53 {\n  errors\n  health {\n    lameduck 5s\n  }\n  ready\n  kubernetes cluster.local in-addr.arpa ip6.arpa {\n    pods insecure\n    fallthrough in-addr.arpa ip6.arpa\n  }\n  prometheus :9153\n  forward . /etc/resolv.conf\n  cache 30\n  loop\n  reload\n  loadbalance\n}",
        "autoScaling": {
          "enabled": true,
          "minReplicas": 4,
          "maxReplicas": 8
        },
        "tolerations": [
          {
            "key": "AppsOnly",
            "effect": "NoSchedule",
            "operator": "Equal",
            "value": "apps"
          },
          {
            "key": "CriticalAddonsOnly",
            "effect": "NoSchedule",
            "operator": "Exists"
          }
        ]
      }
      EOT
    }
  }
...
Enter fullscreen mode Exit fullscreen mode
module "eks" {
  source = "terraform-aws-modules/terraform-aws-eks"
  ...
  cluster_addons = var.addons
  ...
}
Enter fullscreen mode Exit fullscreen mode

OpsGist - Tried‑and‑worked snippets and insights I’ve come across.

Top comments (0)

Create a simple OTP system with AWS Serverless cover image

Create a simple OTP system with AWS Serverless

Implement a One Time Password (OTP) system with AWS Serverless services including Lambda, API Gateway, DynamoDB, Simple Email Service (SES), and Amplify Web Hosting using VueJS for the frontend.

Read full post

👋 Kindness is contagious

Dive into this insightful article, celebrated by the caring DEV Community. Programmers from all walks of life are invited to share and expand our collective wisdom.

A simple thank-you can make someone’s day—drop your kudos in the comments!

On DEV, spreading knowledge paves the way and strengthens our community ties. If this piece helped you, a brief note of appreciation to the author truly counts.

Let’s Go!