我正在尝试使用Terraform Helm提供程序和Azure DevOps容器作业,将ACR中的Helm图表部署到AKS群集,但在从ACR获取Helm图表时失败。请告诉我出了什么问题。
Helm提供程序tf模块:
data "helm_repository" "cluster_rbac_helm_chart_repo" {
name = "mcp-rbac-cluster"
url = "https://mcpshareddcr.azurecr.io"
}
# Deploy Cluster RBAC helm chart onto the cluster
resource "helm_release" "cluster_rbac_helm_chart_release" {
name = "mcp-rbac-cluster"
repository = data.helm_repository.cluster_rbac_helm_chart_repo.metadata[0].name
chart = "mcp-rbac-cluster"
}
提供者:
version = "=1.36.0"
tenant_id = var.ARM_TENANT_ID
subscription_id = var.ARM_SUBSCRIPTION_ID
client_id = var.ARM_CLIENT_ID
client_secret = var.ARM_CLIENT_SECRET
skip_provider_registration = true
}
data "azurerm_kubernetes_cluster" "aks_cluster" {
name = var.aks_cluster
resource_group_name = var.resource_group_aks
}
locals {
kubeconfig_path = "/tmp/kubeconfig"
}
resource "local_file" "kubeconfig" {
filename = local.kubeconfig_path
content = data.azurerm_kubernetes_cluster.aks_cluster.kube_admin_config_raw
}
provider "helm" {
home = "resources/.helm"
kubernetes {
load_config_file = true
config_path = local.kubeconfig_path
}
}
module "aks_resources" {
source = "./modules/helm/aks-resources"
}
错误: Error: 看起来 "" 不是一个有效的图表库或无法访问:获取 /index.yaml 失败 : 404 Not Found
data.helm_repository.cluster_rbac_helm_chart_repo.metadata[0].name
应该是data.helm_repository.cluster_rbac_helm_chart_repo.metadata.0.name
但不确定百分之百。如果您能展示完整的错误信息而不仅仅是当前问题中的摘录,那将非常有用。 - ydaetskcoR