Hello,
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 (https://play2048.co/) 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:
[1]
Failed to create Ingress ‘2048-game/2048-ingress’ because: the server could not find the requested resource (post ingresses.extensions)
│
│ with module.eks.kubernetes_ingress.app,
│ on eks/app.tf line 129, in resource “kubernetes_ingress” “app”:
│ 129: resource “kubernetes_ingress” “app” {
Which references the line here: https://github.com/bsneider/tf-eks-fargate/blob/main/eks/app.tf#L128.
[2]
│ Error: Waiting for default secret of “kube-system/alb-ingress-controller” to appear
│
│ with module.ingress.kubernetes_service_account.ingress,
│ on ingress/main.tf line 250, in resource “kubernetes_service_account” “ingress”:
│ 250: resource “kubernetes_service_account” “ingress” {
│
Found here: https://github.com/bsneider/tf-eks-fargate/blob/main/ingress/main.tf#L230
^^In researching both errors, (first error: K8s upgrade to 1.22.1 - Failed to create Ingress 'XXX' because: the server could not find the requested resource (post ingresses.extensions) · Issue #1386 · hashicorp/terraform-provider-kubernetes · GitHub and second error: Error when creating kubernetes service account "Waiting for default secret to appear" · Issue #31029 · hashicorp/terraform · GitHub), 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/app.tf 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.