AWS EKS: Failure deploying the ALB and service account for the Ingress Controller

Kubernetes version: 1.27

Cloud being used: AWS

Installation method: Terraform

Host OS: Ubuntu 20.04.4 LTS


I am following a tutorial that uses Terraform to deploy EKS resources, including pods on AWS Fargate. The tutorial deploys a webapp for the 2048 game ( that we can access as an endpoint within the cluster. The tutorial was written in February 2020: Running a Kubernetes cluster on EKS with Fargate and Terraform · finleap engineering blog, and the source code is here: GitHub - bsneider/tf-eks-fargate: use terraform to configure and deploy EKS with Fargate to AWS, also deploy sample app.

At the time the tutorial was written, the latest Kubernetes version 1.22, and today’s latest is 1.27. I am also using Terraform v1.2.3 to launch these resources, in addition to using v1.27 for the EKS cluster.

When running the source code, I launched my eks cluster with the latest version, but received the following errors:


Failed to create Ingress ‘2048-game/2048-ingress’ because: the server could not find the requested resource (post ingresses.extensions)

│ with,

│ on eks/ line 129, in resource “kubernetes_ingress” “app”:

│ 129: resource “kubernetes_ingress” “app” {

Which references the line here:


│ Error: Waiting for default secret of “kube-system/alb-ingress-controller” to appear

│ with module.ingress.kubernetes_service_account.ingress,

│ on ingress/ line 250, in resource “kubernetes_service_account” “ingress”:

│ 250: resource “kubernetes_service_account” “ingress” {

Found here:

^^In researching both errors, the solution appears to be downgrading the kubernetes version to 1.22, and structuring the kubernetes_ingress into a resource “kubernetes_ingress_v1” “app” format. However, I got the error:

│ Error: Invalid resource type

│ on eks/ line 169, in resource “kubernetes_ingress_v1” “app”:

│ 169: resource “kubernetes_ingress_v1” “app” {

│ The provider hashicorp/kubernetes does not support resource type “kubernetes_ingress_v1”.

I am wondering if there is a way to rewrite the resource “kubernetes_ingress” “app” so that I can continue to use the latest version of Kubernetes, rather than to revert back to v1.22.