terraform-aws-eks-jx icon indicating copy to clipboard operation
terraform-aws-eks-jx copied to clipboard

Existing cluster demo broken

Open chrislovecnm opened this issue 2 years ago • 4 comments

Summary

The existing cluster demo builds and new VPC and tries to build a new EKS cluster.

Steps to reproduce the behavior

Run the demo in terraform-aws-eks-jx/examples/existing-cluster

Expected behavior

Reuse the VPC and the EKS cluster

Actual behavior

It builds the VPC and tries to create a cluster.

Terraform version

The output of terraform version is:

Tested on master with tf latest and also on v.1.18.11 with 0.13.5

Module version

master and v1.18.11

Operating system

Linux container

chrislovecnm avatar Apr 13 '22 19:04 chrislovecnm

Can you share your main.tf file? Remember you dont need to include https://github.com/jenkins-x/terraform-aws-eks-jx/blob/4240b95efe7558de35eb195d4b3ad76fbe9d0f20/examples/existing-cluster/main.tf#L48-L141. I should make it very clear in the documentation.

ankitm123 avatar Apr 14 '22 10:04 ankitm123

I got the following main.tf working, and yes you do not need to include the vpc and eks stuff, which should not be in the example ;)

// The VPC and EKS resources have been created, just install the cloud resources required by jx
module "eks-jx" {
  source = "jenkins-x/eks-jx/aws"
  region       = var.region
  use_vault    = var.use_vault
  use_asm      = var.use_asm
  cluster_name = var.cluster_name
  is_jx2       = var.is_jx2
  create_eks   = var.create_eks
  create_vpc   = var.create_vpc
  create_nginx = var.create_nginx
  jx_git_url   = var.jx_git_url
  apex_domain  = var.apex_domain
  tls_email    = var.tls_email
  use_kms_s3   = var.use_kms_s3
  registry     = var.registry

  nginx_chart_version = var.nginx_chart_version
  cluster_version     = var.cluster_version
  enable_backup       = var.enable_backup
  jx_bot_username     = var.jx_bot_username
  jx_bot_token        = var.jx_bot_token
  enable_external_dns = var.enable_external_dns

  jx_git_operator_values = var.jx_git_operator_values
  production_letsencrypt = var.production_letsencrypt

}

chrislovecnm avatar Apr 14 '22 16:04 chrislovecnm

Did you want me to file a PR to fix this?

chrislovecnm avatar Apr 15 '22 17:04 chrislovecnm

Did you want me to file a PR to fix this?

Yes, that would be awesome.

I am fine if you want to remove the eks and vpc bits, and only keep the jx part. The reason I kept it was to show ppl how to make an eks and vpc outside of the module, but I can see it can be confusing, and it's just more work to maintain those scripts. Probably a link to examples of vpc and eks module would be sufficient imo (just add some comments in the main.tf)

ankitm123 avatar Apr 19 '22 17:04 ankitm123