Skip to content

Commit c5d2f19

Browse files
milldrNurucloudpossebot
authored
EKS FAQ for Addons (#699)
Co-authored-by: Nuru <[email protected]> Co-authored-by: cloudpossebot <[email protected]>
1 parent 1c86880 commit c5d2f19

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

modules/eks/cluster/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,38 @@ For example:
177177
tags: null
178178
```
179179

180+
### Using Addons
181+
182+
EKS clusters support “Addons” that can be automatically installed on a cluster. Install these addons with the [`var.addons` input](https://docs.cloudposse.com/components/library/aws/eks/cluster/#input_addons).
183+
184+
```yaml
185+
addons:
186+
- addon_name: vpc-cni
187+
addon_version: v1.12.6-eksbuild.2
188+
```
189+
190+
Some addons, such as CoreDNS, require at least one node to be fully provisioned first.
191+
See [issue #170](https://github.com/cloudposse/terraform-aws-eks-cluster/issues/170) for more details.
192+
Set `var.addons_depends_on` to `true` to require the Node Groups to be provisioned before addons.
193+
194+
```yaml
195+
addons_depends_on: true
196+
addons:
197+
- addon_name: coredns
198+
addon_version: v1.25
199+
```
200+
201+
:::warning
202+
203+
Addons may not be suitable for all use-cases! For example, if you are using Karpenter to provision nodes,
204+
these nodes will never be available before the cluster component is deployed.
205+
206+
:::
207+
208+
For more on upgrading these EKS Addons, see
209+
["How to Upgrade EKS Cluster Addons"](https://docs.cloudposse.com/reference-architecture/how-to-guides/upgrades/how-to-upgrade-eks-cluster-addons/)
210+
211+
180212
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
181213
## Requirements
182214

@@ -196,7 +228,7 @@ For example:
196228
| Name | Source | Version |
197229
|------|--------|---------|
198230
| <a name="module_eks"></a> [eks](#module\_eks) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.2 |
199-
| <a name="module_eks_cluster"></a> [eks\_cluster](#module\_eks\_cluster) | cloudposse/eks-cluster/aws | 2.7.0 |
231+
| <a name="module_eks_cluster"></a> [eks\_cluster](#module\_eks\_cluster) | cloudposse/eks-cluster/aws | 2.8.1 |
200232
| <a name="module_fargate_profile"></a> [fargate\_profile](#module\_fargate\_profile) | cloudposse/eks-fargate-profile/aws | 1.2.0 |
201233
| <a name="module_iam_arns"></a> [iam\_arns](#module\_iam\_arns) | ../../account-map/modules/roles-to-principals | n/a |
202234
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../../account-map/modules/iam-roles | n/a |
@@ -227,6 +259,7 @@ For example:
227259
|------|-------------|------|---------|:--------:|
228260
| <a name="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
229261
| <a name="input_addons"></a> [addons](#input\_addons) | Manages [`aws_eks_addon`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) resources | <pre>list(object({<br> addon_name = string<br> addon_version = string<br> resolve_conflicts = string<br> service_account_role_arn = string<br> }))</pre> | `[]` | no |
262+
| <a name="input_addons_depends_on"></a> [addons\_depends\_on](#input\_addons\_depends\_on) | If set `true`, all addons will depend on managed node groups provisioned by this component and therefore not be installed until nodes are provisioned.<br>See [issue #170](https://github.com/cloudposse/terraform-aws-eks-cluster/issues/170) for more details. | `bool` | `false` | no |
230263
| <a name="input_allow_ingress_from_vpc_accounts"></a> [allow\_ingress\_from\_vpc\_accounts](#input\_allow\_ingress\_from\_vpc\_accounts) | List of account contexts to pull VPC ingress CIDR and add to cluster security group.<br><br>e.g.<br><br>{<br> environment = "ue2",<br> stage = "auto",<br> tenant = "core"<br>} | `any` | `[]` | no |
231264
| <a name="input_allowed_cidr_blocks"></a> [allowed\_cidr\_blocks](#input\_allowed\_cidr\_blocks) | List of CIDR blocks to be allowed to connect to the EKS cluster | `list(string)` | `[]` | no |
232265
| <a name="input_allowed_security_groups"></a> [allowed\_security\_groups](#input\_allowed\_security\_groups) | List of Security Group IDs to be allowed to connect to the EKS cluster | `list(string)` | `[]` | no |

modules/eks/cluster/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ locals {
8989

9090
module "eks_cluster" {
9191
source = "cloudposse/eks-cluster/aws"
92-
version = "2.7.0"
92+
version = "2.8.1"
9393

9494
region = var.region
9595
attributes = local.attributes
@@ -122,6 +122,7 @@ module "eks_cluster" {
122122
subnet_ids = var.cluster_private_subnets_only ? local.private_subnet_ids : concat(local.private_subnet_ids, local.public_subnet_ids)
123123
vpc_id = local.vpc_id
124124
addons = var.addons
125+
addons_depends_on = var.addons_depends_on ? [module.region_node_group] : null
125126

126127
kubernetes_config_map_ignore_role_changes = false
127128

modules/eks/cluster/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,12 @@ variable "addons" {
398398
description = "Manages [`aws_eks_addon`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) resources"
399399
default = []
400400
}
401+
402+
variable "addons_depends_on" {
403+
type = bool
404+
description = <<-EOT
405+
If set `true`, all addons will depend on managed node groups provisioned by this component and therefore not be installed until nodes are provisioned.
406+
See [issue #170](https://github.com/cloudposse/terraform-aws-eks-cluster/issues/170) for more details.
407+
EOT
408+
default = false
409+
}

0 commit comments

Comments
 (0)