terraform-aws-eks-blueprints
terraform-aws-eks-blueprints copied to clipboard
[Bug]: could not download chart: Chart.yaml file is missing
Welcome to Amazon EKS Blueprints!
- [X] Yes, I've searched similar issues on GitHub and didn't find any.
Amazon EKS Blueprints Release version
v4.6.1
What is your environment, configuration and the example used?
Terraform v1.1.1
on darwin_arm64
+ provider registry.terraform.io/gavinbunney/kubectl v1.14.0
+ provider registry.terraform.io/hashicorp/aws v4.25.0
+ provider registry.terraform.io/hashicorp/helm v2.6.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.12.1
+ provider registry.terraform.io/hashicorp/time v0.7.2
terragrunt version v0.36.3
What did you do and What did you see instead?
Error: could not download chart: Chart.yaml file is missing
│
│ with module.metrics_server[0].module.helm_addon.helm_release.addon[0],
│ on helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│
╵
╷
│ Error: could not download chart: Chart.yaml file is missing
│
│ with module.prometheus[0].module.helm_addon.helm_release.addon[0],
│ on helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│
╵
╷
│ Error: could not download chart: Chart.yaml file is missing
│
│ with module.cluster_autoscaler[0].module.helm_addon.helm_release.addon[0],
│ on helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│
╵
╷
│ Error: could not download chart: Chart.yaml file is missing
│
│ with module.aws_load_balancer_controller[0].module.helm_addon.helm_release.addon[0],
│ on helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│
╵
ERRO[0086] 1 error occurred:
* exit status 1
Additional Information
I have tried https://github.com/aws-ia/terraform-aws-eks-blueprints/issues/785.
Thank you for reporting this. Can you please run this with TRACE/debug mode and see where the chart is being downloaded from?
A quick search showed https://github.com/hashicorp/terraform-provider-helm/issues/735 which might be the issue, please take a look and let me know if that helps.
Another thing that I saw in your terragrunt.hcl
missing under the addons:
eks_cluster_endpoint = module.eks_blueprints.eks_cluster_endpoint
eks_oidc_provider = module.eks_blueprints.oidc_provider
eks_cluster_version = module.eks_blueprints.eks_cluster_version
(make sure to replace module.eks_blueprints... with the relevant dependency setup you have)
Some charts might use the cluster version (cluster-autoscaler IIRC) as part of the chart version, not sure if this is related but worth to try as-well.
Hi.
I've added ...
eks_cluster_id = dependency.kubernetes.outputs.cluster_id
eks_cluster_endpoint = dependency.kubernetes.outputs.cluster_endpoint
eks_oidc_provider = dependency.kubernetes.outputs.oidc_provider
eks_cluster_version = dependency.kubernetes.outputs.cluster_version
And I still get...
Error: could not download chart: Chart.yaml file is missing
I'm doing a trace now.
Please find the Debug Logs.
Hmmm...unfortunately I couldn't see anything interesting from the logs, wanted to check if it's actually downloading the chart from the correct place.
Do you mind trying this without Terragrunt and see if its working? Also, did you check the provider issues I linked above?
Hi @Zvikan. Please allow me some time to come back to this, I can see the log is incomplete. I will spike and come back to you with a log and any other discoveries I've found.
Hi @Zvikan, I'm encountering the same exact issue.
I was able to temporarily resolve it by cloning the repo and changing the folder names and source references to them in the modules (simple name changes of -
to _
) and pointing my terragrunt source to the local folder.
When pointing terragrunt directly to the modules folder on the repo I'm getting the same-
│ Error: could not download chart: Chart.yaml file is missing
Can confirm issue seems to be -
in folder names.
Hey folks,
I just finished testing this again, I can confirm that I can reproduce the steps mentioned in https://github.com/hashicorp/terraform-provider-helm/issues/735 .
If I created empty folder in the example root example folder (where i'm running the terraform commands), where the folder name is the same as the chart name (e.g. a folder named prometheus
), I will get the Chart.yaml file is missing
, as mentioned in https://github.com/hashicorp/terraform-provider-helm/issues/735#issuecomment-828779466 this is how helm works.
To my understanding, we need to make sure that wherever we run the terraform commands, there's no folder matching the chart name, otherwise helm will pick that folder path and will check its structure and dependencies, leading to the Chart.yaml missing error.
I haven't tested this with terragrunt yet, but without it I can't reproduce this issue (using the k8s-addons module as local/remote git source), I believe that terragrunt is running within the module folder path itself, that's why you may see this behavior with terragrunt only.
I'm not a terragrunt expert, but I wonder if there's a way to tell terragrunt to run TF commands from specific folder? maybe the terragrunt-working-dir arg?
Hi @Zvikan, Due to the fact that terragrunt is just a wrapper for terraform, it caches the referenced source terraform folder structure from the git repo in the terragrunt-download-dir as it currently is, without making any modifications to the files/folders within.
The terragrunt-working-dir only controls which folder to find the terragrunt .hcl files within, which are the ones referencing the terraform modules.
For reference, this is the dry inputs block in my terragrunt.hcl file which is used to call the modules at /modules/kubernetes-addons:
inputs = {
eks_cluster_endpoint = dependency.cluster.outputs.cluster_endpoint
eks_cluster_id = dependency.cluster.outputs.cluster_id
eks_cluster_version = dependency.cluster.outputs.cluster_version
eks_oidc_provider = dependency.cluster.outputs.cluster_oidc_issuer_url
eks_worker_security_group_id = dependency.cluster.outputs.node_security_group_id
enable_metrics_server = true
enable_kubernetes_dashboard = true
metrics_server_helm_config = local.helm_values.inputs.metrics_server_helm_config
tags = dependency.label.outputs.tags
}
I've used this for testing so far and am planning on adding additional modules as we test them out one at a time, but can't implement this due to the current folder names matching the helm chart names.
any solution here? having the same issue with terragrunt and eks-addons
The following workaround works. in terragrunt.hcl you need to put the direct link for the chart and remove repository and version.
enable_metrics_server = true
metrics_server_helm_config = {
name = "metrics-server"
chart = "https://github.com/kubernetes-sigs/metrics-server/releases/download/metrics-server-helm-chart-3.8.2/metrics-server-3.8.2.tgz"
repository = ""
version = ""
namespace = "kube-system"
}
I also had this problem with terragrunt.
My workaround was to not use the kubernetes-addons module directly, but to create an intermediate terraform module which then uses the kubernetes-addons module. This way the helm_release resource context is different and it doesn't find the similarly named directories.
In terragrunt.hcl:
terraform {
source = "${get_repo_root()}/modules/kubernetes-addons"
}
And in the modules/kubernetes-addons/main.tf:
module "kubernetes_addons" {
source = "[email protected]:aws-ia/terraform-aws-eks-blueprints.git//modules/kubernetes-addons/?ref=v4.12.1"
...
}
I'm also experiencing this issue with the latest Blueprint release (v4.12.2). However, I'm not using TerraGrunt at all, I'm just calling the module from the source (source = "github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons?ref=v4.12.2"
).
│ Error: could not download chart: looks like "[https://aws.github.io/eks-charts"](https://aws.github.io/eks-charts%22) is not a valid chart repository or cannot be reached: open /.cache/helm/repository/eL69i4IpgmNHWlXNPGw8YGtS1E8=-index.yaml: no such file or directory with module.eks_blueprints_kubernetes_addons.module.aws_for_fluent_bit[0].module.helm_addon.helm_release.addon[0], on .terraform/modules/eks_blueprints_kubernetes_addons/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│ Error: could not download chart: looks like "[https://kubernetes-sigs.github.io/metrics-server/"](https://kubernetes-sigs.github.io/metrics-server/%22) is not a valid chart repository or cannot be reached: open /.cache/helm/repository/6lXb-uVFtpEGjA757okrE62EazU=-index.yaml: no such file or directory with module.eks_blueprints_kubernetes_addons.module.metrics_server[0].module.helm_addon.helm_release.addon[0], on .terraform/modules/eks_blueprints_kubernetes_addons/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│ Error: could not download chart: looks like "[https://argoproj.github.io/argo-helm"](https://argoproj.github.io/argo-helm%22) is not a valid chart repository or cannot be reached: open /.cache/helm/repository/OELa7V5FYkwirMLcE1KvKEzCEps=-index.yaml: no such file or directory with module.eks_blueprints_kubernetes_addons.module.argocd[0].module.helm_addon.helm_release.addon[0], on .terraform/modules/eks_blueprints_kubernetes_addons/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│ Error: could not download chart: looks like "[https://aws.github.io/eks-charts"](https://aws.github.io/eks-charts%22) is not a valid chart repository or cannot be reached: open /.cache/helm/repository/BD6W6OeuqNxOXE8JbWv7F-6HGWI=-index.yaml: no such file or directory with module.eks_blueprints_kubernetes_addons.module.aws_load_balancer_controller[0].module.helm_addon.helm_release.addon[0], on .terraform/modules/eks_blueprints_kubernetes_addons/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│ Error: could not download chart: looks like "[https://prometheus-community.github.io/helm-charts"](https://prometheus-community.github.io/helm-charts%22) is not a valid chart repository or cannot be reached: open /.cache/helm/repository/uIVrF5yQHNcVcJdhPDyTKQQZ98g=-index.yaml: no such file or directory with module.eks_blueprints_kubernetes_addons.module.prometheus[0].module.helm_addon.helm_release.addon[0], on .terraform/modules/eks_blueprints_kubernetes_addons/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
│ Error: could not download chart: looks like "[https://kubernetes.github.io/autoscaler"](https://kubernetes.github.io/autoscaler%22) is not a valid chart repository or cannot be reached: open /.cache/helm/repository/7uR5TZKcgSnoUpe9s7ifdF2bRyE=-index.yaml: no such file or directory with module.eks_blueprints_kubernetes_addons.module.cluster_autoscaler[0].module.helm_addon.helm_release.addon[0], on .terraform/modules/eks_blueprints_kubernetes_addons/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│ 1: resource "helm_release" "addon" {
Hi Thanks to @danygielow , I've followed his workaround and it finally worked. I've been hitting the wall for the past month, and I can't believe I didn't find this thread earlier. I just copied the variables.tf from the main addons folder, added the relevant part:
module "kubernetes_addons" {
source = "[email protected]:aws-ia/terraform-aws-eks-blueprints.git//modules/kubernetes-addons/?ref=v4.14.0"
# EKS Data
eks_cluster_id = var.eks_cluster_id
eks_oidc_provider = var.eks_oidc_provider
eks_cluster_endpoint = var.eks_cluster_endpoint
eks_cluster_version = var.eks_cluster_version
# EKS Managed Add-ons
enable_amazon_eks_vpc_cni = var.enable_amazon_eks_vpc_cni
enable_amazon_eks_coredns = var.enable_amazon_eks_coredns
enable_amazon_eks_kube_proxy = var.enable_amazon_eks_kube_proxy
enable_amazon_eks_aws_ebs_csi_driver = var.enable_amazon_eks_aws_ebs_csi_driver
#K8s Add-ons
enable_argocd = var.enable_argocd
argocd_manage_add_ons = var.argocd_manage_add_ons
argocd_helm_config = var.argocd_helm_config
enable_argo_rollouts = var.enable_argo_rollouts
enable_aws_load_balancer_controller = var.enable_aws_load_balancer_controller
enable_aws_node_termination_handler = var.enable_aws_node_termination_handler
enable_secrets_store_csi_driver = var.enable_secrets_store_csi_driver
enable_secrets_store_csi_driver_provider_aws = var.enable_secrets_store_csi_driver_provider_aws
enable_cluster_autoscaler = var.enable_cluster_autoscaler
enable_metrics_server = var.enable_metrics_server
enable_kubecost = var.enable_kubecost
tags = var.tags
}
I figured I'd add more as I go along adopting addons.
Thanks
It seems that there is already an issue for this issue in helm. https://github.com/helm/helm/issues/9731
closing for now since the issue is originating from the Helm provider and not from the module/implementation