Azure AKS与agic-如何使用Terraform创建它



我目前正在为AKS环境设置AGIC(Kubernetes应用网关入口控制器((https://azure.github.io/application-gateway-kubernetes-ingress/setup/install-existing/#using-a服务-主要(。

由于整个环境都是用Terraform设置的,我想用Terraform安装必要的Helm存储库。

思考一下,以下简单的代码应该可以做到这一点:


data "helm_repository" "agic_repo" {
name      = "agic_repository"
url       = "https://appgwingress.blob.core.windows.net/ingress-azure-helm-package/"
}
resource "helm_release" "agic" {
name        = "agic"
namespace   = "agic"
repository  = data.helm_repository.agic_repo.metadata[0].url
chart       = "application-gateway-kubernetes-ingress"
depends_on = [
data.helm_repository.agic_repo,
]
}

但我遇到了这个问题:


module.agic.helm_release.agic: Creating...

Error: chart "application-gateway-kubernetes-ingress" not found in https://appgwingress.blob.core.windows.net/ingress-azure-helm-package/ repository

on ../../modules/agic/main.tf line 91, in resource "helm_release" "agic":
91: resource "helm_release" "agic" {

看起来好像找不到包裹。以前有其他人解决过这个问题吗?

我不熟悉Helm,所以我不知道如何在Helm repos中"浏览"以检查我是否在寻址正确的URI。。。

所以我用手动添加了回购

helm repo add application-gateway-kubernetes-ingress https://appgwingress.blob.core.windows.net/ingress-azure-helm-package/

当我搜索我收到的回购时:

V5T:~$ helm search | grep ingress
application-gateway-kubernetes-ingress/ingress-azure    1.0.0           1.0.0                   Use Azure Application Gateway as the ingress for an Azure...

感谢您的帮助!

附言:当然,我可以用bash一行来完成,但如果能用Terraform创建整个环境就太好了。。。

根据您提供的数据,它必须是这样的:

resource "helm_release" "agic" {
name        = "agic"
namespace   = "agic"
repository  = data.helm_repository.agic_repo.metadata[0].url
chart       = "ingress-azure"
depends_on = [
data.helm_repository.agic_repo,
]
}

因此图表名称与不同

最新更新