From 13b8bffa5a97b6dc34ef65ab8ead7d793fc4a06e Mon Sep 17 00:00:00 2001 From: Jay Patel <78554593+jarpat@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:03:28 -0500 Subject: [PATCH] feat: (IAC-903): add K8s 1.25 support, set kubectl default to 1.24 (#189) --- Dockerfile | 2 +- README.md | 2 +- docs/CONFIG-VARS.md | 2 +- examples/sample-input-byo.tfvars | 2 +- examples/sample-input-connect.tfvars | 2 +- examples/sample-input-custom-data.tfvars | 2 +- examples/sample-input-gpu.tfvars | 2 +- examples/sample-input-ha.tfvars | 2 +- examples/sample-input-minimal.tfvars | 2 +- examples/sample-input-singlestore.tfvars | 2 +- examples/sample-input.tfvars | 2 +- modules/aws_autoscaling/main.tf | 7 +++++++ variables.tf | 2 +- 13 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 08c7d329..a6ec677a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG AWS_CLI_VERSION=2.7.22 FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform FROM amazon/aws-cli:$AWS_CLI_VERSION -ARG KUBECTL_VERSION=1.23.8 +ARG KUBECTL_VERSION=1.24.10 WORKDIR /viya4-iac-aws diff --git a/README.md b/README.md index dfeef405..a23f6cab 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The following are also required: #### Terraform Requirements: - [Terraform](https://www.terraform.io/downloads.html) v1.0.0 -- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - v1.23.8 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - v1.24.10 - [jq](https://stedolan.github.io/jq/) v1.6 - [AWS CLI](https://aws.amazon.com/cli) (optional; useful as an alternative to the AWS Web Console) v2.7.22 diff --git a/docs/CONFIG-VARS.md b/docs/CONFIG-VARS.md index 09fe78a7..e88aa885 100644 --- a/docs/CONFIG-VARS.md +++ b/docs/CONFIG-VARS.md @@ -197,7 +197,7 @@ Custom policy: |
Name
|
Description
|
Type
|
Default
|
Notes
| | :--- | :--- | :--- | :--- | :--- | | create_static_kubeconfig | Allows the user to create a provider- or service account-based kubeconfig file | bool | true | A value of `false` defaults to using the cloud provider's mechanism for generating the kubeconfig file. A value of `true` creates a static kubeconfig that uses a service account and cluster role binding to provide credentials. | -| kubernetes_version | The EKS cluster Kubernetes version | string | "1.23" | | +| kubernetes_version | The EKS cluster Kubernetes version | string | "1.24" | | | create_jump_vm | Create bastion host (jump VM) | bool | true| | | create_jump_public_ip | Add public IP address to jump VM | bool | true | | | jump_vm_admin | OS admin user for the jump VM | string | "jumpuser" | | diff --git a/examples/sample-input-byo.tfvars b/examples/sample-input-byo.tfvars index 98f872b0..cc9efdb4 100644 --- a/examples/sample-input-byo.tfvars +++ b/examples/sample-input-byo.tfvars @@ -37,7 +37,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/examples/sample-input-connect.tfvars b/examples/sample-input-connect.tfvars index 28485cbb..4a9b9559 100644 --- a/examples/sample-input-connect.tfvars +++ b/examples/sample-input-connect.tfvars @@ -27,7 +27,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/examples/sample-input-custom-data.tfvars b/examples/sample-input-custom-data.tfvars index 2cbefc5d..adff9b7c 100644 --- a/examples/sample-input-custom-data.tfvars +++ b/examples/sample-input-custom-data.tfvars @@ -27,7 +27,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/examples/sample-input-gpu.tfvars b/examples/sample-input-gpu.tfvars index 297adb3b..ab1790db 100644 --- a/examples/sample-input-gpu.tfvars +++ b/examples/sample-input-gpu.tfvars @@ -27,7 +27,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/examples/sample-input-ha.tfvars b/examples/sample-input-ha.tfvars index e5b9c83e..a1a532be 100644 --- a/examples/sample-input-ha.tfvars +++ b/examples/sample-input-ha.tfvars @@ -27,7 +27,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/examples/sample-input-minimal.tfvars b/examples/sample-input-minimal.tfvars index 97a50a06..976ce22e 100644 --- a/examples/sample-input-minimal.tfvars +++ b/examples/sample-input-minimal.tfvars @@ -27,7 +27,7 @@ tags = {} # e.g., { "key1" = "value1", "key2" = "value2" } # } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 1 default_nodepool_vm_type = "m5.large" default_nodepool_custom_data = "" diff --git a/examples/sample-input-singlestore.tfvars b/examples/sample-input-singlestore.tfvars index dcb4e072..8ca55faa 100644 --- a/examples/sample-input-singlestore.tfvars +++ b/examples/sample-input-singlestore.tfvars @@ -27,7 +27,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/examples/sample-input.tfvars b/examples/sample-input.tfvars index f39c9460..a829d21f 100644 --- a/examples/sample-input.tfvars +++ b/examples/sample-input.tfvars @@ -27,7 +27,7 @@ postgres_servers = { } ## Cluster config -kubernetes_version = "1.23" +kubernetes_version = "1.24" default_nodepool_node_count = 2 default_nodepool_vm_type = "m5.2xlarge" default_nodepool_custom_data = "" diff --git a/modules/aws_autoscaling/main.tf b/modules/aws_autoscaling/main.tf index c6de6979..cdd783d5 100644 --- a/modules/aws_autoscaling/main.tf +++ b/modules/aws_autoscaling/main.tf @@ -1,3 +1,5 @@ +# Permissions based off the IAM Policy recommended by kubernetes/autoscaler +# https://github.com/kubernetes/autoscaler/blob/cluster-autoscaler-chart-9.25.0/cluster-autoscaler/cloudprovider/aws/README.md data "aws_iam_policy_document" "worker_autoscaling" { statement { sid = "eksWorkerAutoscalingAll" @@ -7,7 +9,9 @@ data "aws_iam_policy_document" "worker_autoscaling" { "autoscaling:DescribeAutoScalingGroups", "autoscaling:DescribeAutoScalingInstances", "autoscaling:DescribeLaunchConfigurations", + "autoscaling:DescribeScalingActivities", "autoscaling:DescribeTags", + "ec2:DescribeInstanceTypes", "ec2:DescribeLaunchTemplateVersions", ] @@ -22,6 +26,9 @@ data "aws_iam_policy_document" "worker_autoscaling" { "autoscaling:SetDesiredCapacity", "autoscaling:TerminateInstanceInAutoScalingGroup", "autoscaling:UpdateAutoScalingGroup", + "ec2:DescribeImages", + "ec2:GetInstanceTypesFromInstanceRequirements", + "eks:DescribeNodegroup" ] resources = ["*"] diff --git a/variables.tf b/variables.tf index 8c96f712..a2e051c0 100644 --- a/variables.tf +++ b/variables.tf @@ -100,7 +100,7 @@ variable "efs_performance_mode" { variable "kubernetes_version" { description = "The EKS cluster Kubernetes version." type = string - default = "1.23" + default = "1.24" } variable "tags" {