在尝试创建代理后的AKS时,AKS未能在节点池中启动Worker Node,但由于连接超时错误,https://mcr.microsoft.com/ 443失败。
尝试使用以下参数,但获得错误https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#http_proxy_config
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 = ╷
│ 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
发布于 2021-12-23 13:12:07
您必须在http_proxy资源块中的http_proxy_config块中声明http_proxy_config、https_proxy和no_proxy。
代码如下所示:
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。
https://stackoverflow.com/questions/70460982
复制相似问题