首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法创建员工节点的AKS

无法创建员工节点的AKS
EN

Stack Overflow用户
提问于 2021-12-23 10:41:07
回答 1查看 201关注 0票数 0

在尝试创建代理后的AKS时,AKS未能在节点池中启动Worker Node,但由于连接超时错误,https://mcr.microsoft.com/ 443失败。

尝试使用以下参数,但获得错误https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#http_proxy_config

代码语言:javascript
复制
resource "azurerm_kubernetes_cluster" "aks_cluster" {
  name                       = 
  location                   = 
  resource_group_name        = 
  dns_prefix                 = 
  kubernetes_version        = 
  kubernetes_version         = 
  node_resource_group        = 
  private_cluster_enabled    = 
  http_proxy                 = 
  https_proxy                = 
  no_proxy                   = 
代码语言:javascript
复制
╷
│ Error: Unsupported argument
│ 
│   on aks_cluster.tf line 60, in resource "azurerm_kubernetes_cluster" "aks_cluster":
│   60:   http_proxy                 = "export http_proxy=http:"
│ 
│ An argument named "http_proxy" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on aks_cluster.tf line 61, in resource "azurerm_kubernetes_cluster" "aks_cluster":
│   61:   https_proxy                = "export https_proxy=http://"
│ 
│ An argument named "https_proxy" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on aks_cluster.tf line 62, in resource "azurerm_kubernetes_cluster" "aks_cluster":
│   62:   no_proxy                   = "localhost,"
│ 
│ An argument named "no_proxy" is not expected here.
╵
##[error]Terraform command 'validate' failed with exit code

Another one

│   on aks_cluster.tf line 70, in resource "azurerm_kubernetes_cluster" "aks_cluster":
│   70:     http_proxy_config     = "export https_proxy=http:///"
│ 
│ An argument named "http_proxy_config" is not expected here

我做了:https://learn.microsoft.com/en-us/azure/aks/http-proxy checked:https://github.com/hashicorp/terraform-provider-azurerm/pull/14177

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-23 13:12:07

您必须在http_proxy资源块中的http_proxy_config块中声明http_proxy_confighttps_proxyno_proxy

代码如下所示:

代码语言:javascript
复制
resource "azurerm_kubernetes_cluster" "example" {
  name                = "ansuman-aks1"
  location            = data.azurerm_resource_group.example.location
  resource_group_name = data.azurerm_resource_group.example.name
  dns_prefix          = "ansumanaks1"

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_D2_v2"
  }

  identity {
    type = "SystemAssigned"
  }
http_proxy_config {
    http_proxy                 = "http://myproxy.server.com:8080/"
    https_proxy                = "https://myproxy.server.com:8080/"
    no_proxy                   = ["localhost","127.0.0.1"]
}
}

输出:

注意:请确保您已经在订阅中注册了HTTPProxyConfigPreview功能,并且在注册之后,您已经注册了提供者Microsoft.ContainerService以使该功能生效,如本.Also所述,请确保您提供了正确的代理API。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70460982

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档