GeezerVison is showing github.com — bump eks module version (#220) · commitdev/zero-aws-eks-stack@b50abfa
File tree
Expand file treeCollapse file tree
Open diff view settings
kubernetes/terraform/modules/kubernetes
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc-site/docs/guides/kubernetes-cluster.md +10-1Lines changed: 10 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -210,7 +210,7 @@ aws eks describe-addon-versions \ |
210 | 210 | </Tabs> |
211 | 211 | The process should be: |
212 | 212 |
|
213 | | -- Update the addon versions versions in `<env>/main.tf` to match the correct versions for the new cluster version. See the tabs above or [read the AWS docs here](https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html) |
| 213 | +- Update the addons in `<env>/main.tf` to match the correct addon versions for the new cluster version. See the tabs above or [read the AWS docs here](https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html) |
214 | 214 | - Update the `eks_cluster_version` in terraform |
215 | 215 | - Run `terraform apply` |
216 | 216 | - Update your nodes to the new version |
@@ -222,6 +222,15 @@ The process should be: |
222 | 222 |
|
223 | 223 | This will bring up new nodes, gracefully drain your workloads onto them while preventing new pods from being scheduled to the old ones, then take down the old nodes. If your workloads are set up with multiple replicas there should be no downtime during this process. |
224 | 224 |
|
| 225 | +:::note |
| 226 | +You can't upgrade the addons by more than one minor version at a time. So for example you couldn't change from "v1.7.10" to "v1.9.0". You would first need to go to "v1.8.0", apply, then update to "v1.9.0". |
| 227 | +::: |
| 228 | + |
| 229 | +:::tip |
| 230 | +Sometimes you may need to make changes to node groups that would be destructive to the nodes in your cluster, for example changing the type of instances in the group. In situations like this you can apply in stages where you would add a new node group with a unique name and the new instance types. You can apply to bring up this new group of instances, then remove the old group and apply again. This will make sure you always have sufficient nodes in your cluster to handle your workloads. |
| 231 | +::: |
| 232 | + |
| 233 | + |
225 | 234 | ## More resources |
226 | 235 |
|
227 | 236 | [https://kubernetes.io/docs/reference/kubectl/cheatsheet/](https://kubernetes.io/docs/reference/kubectl/cheatsheet/) |
|
Collapse file
Copy file name to clipboardExpand all lines: templates/kubernetes/terraform/modules/kubernetes/metrics_server.tf +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,12 +9,11 @@ resource "helm_release" "metrics_server" { |
9 | 9 | # Switch away from this bitnami one when possible. https://github.com/kubernetes-sigs/metrics-server/issues/572 |
10 | 10 | repository = "https://charts.bitnami.com/bitnami" |
11 | 11 | chart = "metrics-server" |
12 | | - version = "5.0.2" |
| 12 | + version = "5.9.2" |
13 | 13 | namespace = local.metrics_server_namespace |
14 | 14 |
|
15 | 15 | set { |
16 | 16 | name = "apiService.create" |
17 | 17 | value = true |
18 | 18 | } |
19 | 19 | } |
20 | | - |
Collapse file
Copy file name to clipboardExpand all lines: templates/terraform/environments/prod/main.tf +4-6Lines changed: 4 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -56,12 +56,12 @@ module "prod" { |
56 | 56 | ecr_repositories = [] # Should be created by the staging environment |
57 | 57 |
|
58 | 58 | # EKS configuration |
59 | | - eks_cluster_version = "1.20" |
| 59 | + eks_cluster_version = "1.21" |
60 | 60 | # Cluster addons. These often need to be updated when upgrading the cluster version. |
61 | 61 | # See: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html |
62 | | - eks_addon_vpc_cni_version = "v1.7.10-eksbuild.1" |
63 | | - eks_addon_kube_proxy_version = "v1.20.4-eksbuild.2" |
64 | | - eks_addon_coredns_version = "v1.8.3-eksbuild.1" |
| 62 | + eks_addon_vpc_cni_version = "v1.9.0-eksbuild.1" |
| 63 | + eks_addon_kube_proxy_version = "v1.21.2-eksbuild.2" |
| 64 | + eks_addon_coredns_version = "v1.8.4-eksbuild.1" |
65 | 65 |
|
66 | 66 | eks_node_groups = { |
67 | 67 | main = { |
@@ -71,8 +71,6 @@ module "prod" { |
71 | 71 | # Enable use of spot instances instead of on-demand. |
72 | 72 | # This can provide significant cost savings and should be stable due to the use of the termination handler, but means that individuial nodes could be restarted at any time. May not be suitable for clusters with long-running workloads |
73 | 73 | use_spot_instances = false |
74 | | - # This is the normal image. Other possibilities are AL2_x86_64_GPU for gpu instances or AL2_ARM_64 for ARM instances |
75 | | - ami_type = "AL2_x86_64" |
76 | 74 | } |
77 | 75 | } |
78 | 76 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: templates/terraform/environments/stage/main.tf +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,7 @@ module "stage" { |
70 | 70 | eks_cluster_version = "1.21" |
71 | 71 | # Cluster addons. These often need to be updated when upgrading the cluster version. |
72 | 72 | # See: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html |
73 | | - eks_addon_vpc_cni_version = "v1.7.10-eksbuild.1" |
| 73 | + eks_addon_vpc_cni_version = "v1.9.0-eksbuild.1" |
74 | 74 | eks_addon_kube_proxy_version = "v1.21.2-eksbuild.2" |
75 | 75 | eks_addon_coredns_version = "v1.8.4-eksbuild.1" |
76 | 76 |
|
@@ -82,8 +82,6 @@ module "stage" { |
82 | 82 | # Enable use of spot instances instead of on-demand. |
83 | 83 | # This can provide significant cost savings and should be stable due to the use of the termination handler, but means that individuial nodes could be restarted at any time. May not be suitable for clusters with long-running workloads |
84 | 84 | use_spot_instances = true |
85 | | - # This is the normal image. Other possibilities are AL2_x86_64_GPU for gpu instances or AL2_ARM_64 for ARM instances |
86 | | - ami_type = "AL2_x86_64" |
87 | 85 | } |
88 | 86 | } |
89 | 87 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: templates/terraform/modules/environment/main.tf +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -56,7 +56,7 @@ data "aws_caller_identity" "current" {} |
56 | 56 | # Provision the EKS cluster |
57 | 57 | module "eks" { |
58 | 58 | source = "commitdev/zero/aws//modules/eks" |
59 | | - version = "0.4.5" |
| 59 | + version = "0.5.0" |
60 | 60 | providers = { |
61 | 61 | aws = aws.for_eks |
62 | 62 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: templates/terraform/modules/environment/variables.tf +2-8Lines changed: 2 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -47,14 +47,8 @@ variable "eks_addon_coredns_version" { |
47 | 47 | } |
48 | 48 |
|
49 | 49 | variable "eks_node_groups" { |
50 | | - type = map(object({ |
51 | | - instance_types = list(string) |
52 | | - asg_min_size = string |
53 | | - asg_max_size = string |
54 | | - use_spot_instances = bool |
55 | | - ami_type = string |
56 | | - })) |
57 | | - description = "Map of maps of eks node group config where keys are node group names" |
| 50 | + type = any |
| 51 | + description = "Map of maps of eks node group config where keys are node group names. See the EKS module documentation for details" |
58 | 52 | } |
59 | 53 |
|
60 | 54 | variable "hosted_domains" { |
|