awslabs / crossplane-on-eks

Crossplane bespoke composition blueprints for AWS resources
Apache License 2.0
307 stars 109 forks source link

[Bug]: Cannot use tofu apply to create terraform resources "as-is" #199

Open ucfchandra opened 2 weeks ago

ucfchandra commented 2 weeks ago

Welcome to AWS Blueprints for Crossplane!

AWS Blueprints for Crossplane Release version

First release

What is your environment, configuration and the example used?

Mac OS, example was the terraform bootstrap

What did you do and What did you see instead?

I attempted Tofu apply and got the following errors:

Warning: Helm release "argo-cd" was created but has a failed status. Use the `helm` command to investigate the error, correct it, then run Terraform again.
│ 
│   with module.eks_blueprints_addons.module.argocd.helm_release.this[0],
│   on .terraform/modules/eks_blueprints_addons.argocd/main.tf line 9, in resource "helm_release" "this":
│    9: resource "helm_release" "this" {
│ 
╵
╷
│ Error: failed to create resource: Internal error occurred: failed calling webhook "mservice.elbv2.k8s.aws": failed to call webhook: Post "https://aws-load-balancer-webhook-service.kube-system.svc:443/mutate-v1-service?timeout=10s": no endpoints available for service "aws-load-balancer-webhook-service"
│ 
│   with module.eks_blueprints_addons.module.argocd.helm_release.this[0],
│   on .terraform/modules/eks_blueprints_addons.argocd/main.tf line 9, in resource "helm_release" "this":
│    9: resource "helm_release" "this" {

Additional Information

I was able to successfully work around this issue by changing `wait = true` to `wait = false` in the EKS Addons section under `argocd`
edgarsilva948 commented 2 weeks ago

Hello @ucfchandra,

Thank you for bringing this!

It looks like the problem arises due to ArgoCD Helm installation being initiated before all cluster addons are fully operational. To address this, I've made some adjustments in this PR.

I've added this parameter to the VPC-CNI addon to ensure that it fully initializes before we attempt the ArgoCD Helm install. Additionally, I've added a sleep time to provide a buffer and ensure that everything is up and running. These changes should resolve the timing issue and prevent the errors you encountered.