Ran*_*sts 9 kubernetes google-kubernetes-engine terraform terraform-provider-kubernetes
我正在创建一个 kubernetes 集群来托管服务,并添加一个内部负载均衡器来在我的 VM 实例和 kubernetes 集群之间路由流量。我想向负载均衡器前端添加服务标签,以便我可以使用 dns 名称而不是 IP 地址。但我不知道用于添加服务标签的注释?我的 terraform 配置如下所示
知道在哪里可以找到支持的注释列表
resource "kubernetes_manifest" "service_ilb" {
provider = kubernetes-alpha
manifest = {
"apiVersion" = "v1"
"kind" = "Service"
"metadata" = {
"name" = "ilb-service"
"namespace" = var.namespace
"annotations" = {
"cloud.google.com/load-balancer-type" = "Internal"
"networking.gke.io/internal-load-balancer-allow-global-access" = "true"
"networking.gke.io/internal-load-balancer-subnet" = var.subnetwork
# Does not work
"networking.gke.io/internal-load-balancer-service-label" = "my-dns-name"
}
"labels" = {
"app.kubernetes.io/component" = "rabbitmq-server"
"app.kubernetes.io/name" = "rabbitmq-instance"
}
}
"spec" = {
"type" = "LoadBalancer"
"ports" = [
{
"name" = "amqp-tls"
"port" = 5671
"targetPort" = 5671
"protocol" = "TCP"
"nodePort" = 31212
},
{
"name" = "http"
"port" = 15672
"targetPort" = 15672
"protocol" = "TCP"
"nodePort" = 32511
},
]
"selector" = {
"app.kubernetes.io/component" = "rabbitmq-server"
"app.kubernetes.io/name" = "rabbitmq-instance"
}
}
}
/*
wait_for = {
fields = {
# Check an ingress has an IP
"status.loadBalancer.ingress.0.ip" = "^(\\d+(\\.|$)){4}"
}
}
*/
}
Run Code Online (Sandbox Code Playgroud)
提前致谢
| 归档时间: |
|
| 查看次数: |
441 次 |
| 最近记录: |