微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Helm 包部署入口控制器 aks 使用 terraform

如何解决Helm 包部署入口控制器 aks 使用 terraform

这是当前为aks集群创建Nginx控制器的脚本,下面是代码

resource "azurerm_public_ip" "ingress" {
  name                = "AKS-Ingress-Controller"
  resource_group_name = var.resource_group_name
  location            = var.location
  allocation_method   = "Static"
}

resource "helm_release" "Nginx_ingress" {
  name       = "ingress-Nginx"
  namespace        = var.Nginx_name
  create_namespace = true
  repository  = "https://kubernetes.github.io/ingress-Nginx"
  chart      = "ingress-Nginx"

  set {
    name  = "rbac.create"
    value = "false"
  }
  set {
    name  = "service.type"
    value = "ClusterIP"
  }
  set {
    name  = "controller.service.externalTrafficPolicy"
    value = "Local"
  }
  set {
    name  = "controller.replicaCount"
    value = "2"
  }
  set {
    name  = "controller.nodeselector.kubernetes\\.io/os" 
    value = "linux"
  }
  set {
    name  = "defaultBackend.nodeselector.kubernetes\\.io/os"
    value = "linux"
  }
  set {
    name = "controller.admissionWebhooks.patch.nodeselector.kubernetes\\.io/os"
    value = "linux"
  }
  set {
      name= "controller.service.type"
      value= "LoadBalancer"
  } 
   set {
      name ="controller.service.loadBalancerIP"
      value= azurerm_public_ip.ingress.ip_address
  } 
  set {
      name ="controller.service.annotations.service.kubernetes\\.io/azure-load-balancer-resource-group"
      value= var.resource_group_name
  } 
}

我不确定我做错了什么?如果有人能指出我正确的方向,我将不胜感激。 脚本完成后,Pod 不会说 CrashLoopBackOff

NAMESPACE                            NAME                                                              READY   STATUS             RESTARTS   AGE
aksns-eu2-siesmart-d-ngnix-ingress   ingress-Nginx-controller-7fc74cf778-d8m7q                         0/1     CrashLoopBackOff   8          17m
aksns-eu2-siesmart-d-ngnix-ingress   ingress-Nginx-controller-7fc74cf778-gj8rk                         0/1     CrashLoopBackOff   8          17m

我不知道错误在哪里..你能帮我吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。