aws-quickstart / cdk-eks-blueprints

AWS Quick Start Team
Apache License 2.0
446 stars 198 forks source link

Feature Request: Update CoreDNS and the CoreDNS Addon's Default's that eks blueprints uses #1066

Open neoakris opened 4 weeks ago

neoakris commented 4 weeks ago

Describe the feature

Problem Statement: AWS's EKS Upstream has poor default values for CoreDNS
Feature Request: Have future version of EKS Blueprints default to better defaults, specifically:

Use Case

EKS Blueprints is supposed to implement best practices by default. Best practice is

  1. hard requirement to spread coredns replicas across nodes, vs a soft preference.
  2. coredns autoscaling enabled by default.

Just because EKS upstream has poor default values doesn't mean this project should.

Proposed Solution

Have a future version of EKS Blueprints use the following default values for CoreDNS Note: "auto" would have to map to a supported version of the addon. (like "v1.11.1-eksbuild.11")

new blueprints.addons.CoreDnsAddOn( "v1.11.1-eksbuild.11", {
    configurationValues: {
            "autoScaling": {
              "enabled": true,
              "minReplicas": 2,
              "maxReplicas": 100
            },
            "affinity": {
              "nodeAffinity": {
                "requiredDuringSchedulingIgnoredDuringExecution": {
                  "nodeSelectorTerms": [
                    {
                      "matchExpressions": [
                        {
                          "key": "kubernetes.io/os",
                          "operator": "In",
                          "values": [
                            "linux"
                          ]
                        },
                        {
                          "key": "kubernetes.io/arch",
                          "operator": "In",
                          "values": [
                            "amd64",
                            "arm64"
                          ]
                        }
                      ]
                    }
                  ]
                }
              },
              "podAntiAffinity": {
                "requiredDuringSchedulingIgnoredDuringExecution": [
                  {
                    "labelSelector": {
                      "matchExpressions": [
                        {
                          "key": "k8s-app",
                          "operator": "In",
                          "values": [
                            "kube-dns"
                          ]
                        }
                      ]
                    },
                    "topologyKey": "kubernetes.io/hostname"
                  }
                ]
              }
            }
    } //end CoreDNS configurationValues override
  }) //end CoreDNS AddOn

Other Information

aws eks describe-addon-configuration --addon-name coredns --addon-version v1.11.1-eksbuild.8 --query configurationSchema --output text | jq .
^-- shows autoscaling is not available on the older version
(the above shows a shema, with autoscaling missing)

aws eks describe-addon-configuration --addon-name coredns --addon-version v1.11.1-eksbuild.11 --query configurationSchema --output text | jq .
^-- shows autoscaling is available in the newer version aws eks describe-addon-configuration --addon-name coredns --addon-version v1.11.1-eksbuild.11 --query configurationSchema --output text | jq . | grep auto

        "autoScaling": {
          "description": "autoScaling configurations",

Useful Note about cdk-eks-blueprints v1.15.1:

Acknowledgements

CDK version used

2.133.0

EKS Blueprints Version

1.15.1

Node.js Version

v20.15.0

Environment details (OS name and version, etc.)

Mac OS Sonoma 14.5

neoakris commented 3 weeks ago

ugh ok, nvm I'll edit this, there's no upstream bug. I just typo'd the auto scaling part "autoscaling" --> "autoScaling", that said the feature request is still valid.