Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ Upgrades must be executed in step-wise fashion from one version to the next. You

See our upgrade guide [here](./docs/operator-migration/readme.md)

### Upgrading from 1.x -> 2.x

- ~>4.0 version required for AWS Provider

### Upgrading from 2.x -> 3.x

- No changes required by you

### Upgrading from 4.x -> 5.x

5.0.0 introduced autoscaling to the EKS cluster and made the `size` variable the preferred way to set the cluster size.
Expand Down Expand Up @@ -394,10 +402,9 @@ This can be donw by adding the following policy document.
We are considering this a major change because of the terraform `moved` block which migrates the resource. After moving to a `v7` applying an earlier version of the module may result in terraform deleting your bucket.

removed the `create_bucket` var due to the above.
### Upgrading from 2.x -> 3.x

- No changes required by you
### 7.x -> 8.x

### Upgrading from 1.x -> 2.x
`v8` allows for consumers of this terraform module so specify if they want to install `external-dns`, `aws-load-balancer-controller`, or `cluster-autoscaler` or not.

- ~>4.0 version required for AWS Provider
They will continue to install by default. However, the new `moved` blocks to migrate them may cause the helm charts to be removed and reinstalled if you try and downgrade.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ module "app_eks" {

aws_loadbalancer_controller_tags = var.aws_loadbalancer_controller_tags

enable_aws_loadbalancer_controller = var.enable_aws_loadbalancer_controller
enable_external_dns = var.enable_external_dns
enable_cluster_autoscaler = var.enable_cluster_autoscaler

eks_addon_efs_csi_driver_version = var.eks_addon_efs_csi_driver_version
eks_addon_ebs_csi_driver_version = var.eks_addon_ebs_csi_driver_version
eks_addon_coredns_version = var.eks_addon_coredns_version
Expand Down
8 changes: 7 additions & 1 deletion modules/app_eks/cluster_autoscaler/cluster_autoscaler.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
data "aws_region" "current" {}

resource "helm_release" "cluster-autoscaler" {
count = var.enable_cluster_autoscaler ? 1 : 0
chart = "cluster-autoscaler"
name = "cluster-autoscaler"
repository = "https://kubernetes.github.io/autoscaler"
Expand Down Expand Up @@ -46,4 +47,9 @@ resource "helm_release" "cluster-autoscaler" {
name = "extraArgs.balancing-ignore-label"
value = "topology.ebs.csi.aws.com/zone"
}
}
}

moved {
from = helm_release.cluster-autoscaler
to = helm_release.cluster-autoscaler[0]
}
6 changes: 6 additions & 0 deletions modules/app_eks/cluster_autoscaler/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ variable "oidc_provider" {
url = string
})
}

variable "enable_cluster_autoscaler" {
description = "Whether to enable the cluster autoscaler addon"
type = bool
default = true
}
6 changes: 6 additions & 0 deletions modules/app_eks/external_dns/external_dns.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "helm_release" "external_dns" {
count = var.enable_external_dns ? 1 : 0
name = "external-dns"
namespace = "kube-system"
chart = "external-dns"
Expand Down Expand Up @@ -40,3 +41,8 @@ resource "helm_release" "external_dns" {
value = aws_iam_role.default.arn
}
}

moved {
from = helm_release.external_dns
to = helm_release.external_dns[0]
}
6 changes: 6 additions & 0 deletions modules/app_eks/external_dns/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ variable "oidc_provider" {
variable "fqdn" {
type = string
}

variable "enable_external_dns" {
description = "Whether to enable the external dns addon"
type = bool
default = true
}
6 changes: 6 additions & 0 deletions modules/app_eks/lb_controller/controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
}

resource "helm_release" "aws_load_balancer_controller" {
count = var.enable_aws_loadbalancer_controller ? 1 : 0
name = "aws-load-balancer-controller"
repository = "https://aws.github.io/eks-charts"
chart = "aws-load-balancer-controller"
Expand Down Expand Up @@ -36,3 +37,8 @@ EOT

depends_on = [aws_iam_role_policy_attachment.default]
}

moved {
from = helm_release.aws_load_balancer_controller
to = helm_release.aws_load_balancer_controller[0]
}
6 changes: 6 additions & 0 deletions modules/app_eks/lb_controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ variable "oidc_provider" {
variable "aws_loadbalancer_controller_tags" {
type = map(string)
}

variable "enable_aws_loadbalancer_controller" {
description = "Whether to enable the AWS Load Balancer Controller addon"
type = bool
default = true
}
6 changes: 6 additions & 0 deletions modules/app_eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ module "lb_controller" {
oidc_provider = aws_iam_openid_connect_provider.eks
aws_loadbalancer_controller_tags = var.aws_loadbalancer_controller_tags

enable_aws_loadbalancer_controller = var.enable_aws_loadbalancer_controller

depends_on = [module.eks]
}

Expand All @@ -178,6 +180,8 @@ module "external_dns" {
oidc_provider = aws_iam_openid_connect_provider.eks
fqdn = var.fqdn

enable_external_dns = var.enable_external_dns

depends_on = [module.eks]
}

Expand All @@ -187,5 +191,7 @@ module "cluster_autoscaler" {
namespace = var.namespace
oidc_provider = aws_iam_openid_connect_provider.eks

enable_cluster_autoscaler = var.enable_cluster_autoscaler

depends_on = [module.eks]
}
18 changes: 18 additions & 0 deletions modules/app_eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,24 @@ variable "aws_loadbalancer_controller_tags" {
default = {}
}

variable "enable_aws_loadbalancer_controller" {
description = "Whether to enable the AWS Load Balancer Controller addon"
type = bool
default = true
}

variable "enable_cluster_autoscaler" {
description = "Whether to enable the cluster autoscaler addon"
type = bool
default = true
}

variable "enable_external_dns" {
description = "Whether to enable the external dns addon"
type = bool
default = true
}

variable "eks_addon_efs_csi_driver_version" {
description = "The version of the EFS CSI driver to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ variable "size" {
default = "small"
}

variable "enable_cluster_autoscaler" {
type = bool
description = "Whether to enable the cluster autoscaler addon"
default = true
}

##########################################
# Operator #
##########################################
Expand Down Expand Up @@ -119,6 +125,12 @@ variable "external_dns" {
description = "Using external DNS. A `subdomain` must also be specified if this value is true."
}

variable "enable_external_dns" {
description = "Whether to enable the external dns addon"
type = bool
default = true
}

variable "custom_domain_filter" {
description = "A custom domain filter to be used by external-dns instead of the default FQDN. If not set, the local FQDN is used."
type = string
Expand Down Expand Up @@ -416,6 +428,12 @@ variable "aws_loadbalancer_controller_tags" {
type = map(string)
default = {}
}

variable "enable_aws_loadbalancer_controller" {
description = "Whether to enable the AWS Load Balancer Controller addon"
type = bool
default = true
}
##########################################
# EKS Cluster Addons #
##########################################
Expand Down
Loading