我想使用 Terraform 设置以下注释
nginx.ingress.kubernetes.io/server-snippet: |-
location ~* /admin {
allow xxx.xxx.xxx.xxx;
deny all;
}
只要是像下面提到的字符串我就可以设置注释
resource "helm_release" "keycloak" {
repository = "https://charts.bitnami.com/bitnami"
chart = "keycloak"
namespace = kubernetes_namespace.keycloak.metadata[0].name
name = "keycloak"
set {
name = "replicaCount"
value = 1
}
}
但我没有看到任何关于 "nginx.ingress.kubernetes.io/server-snippet:"
的参考nginx.ingress.kubernetes.io/server-snippet: |-
location ~* /admin {
allow xxx.xxx.xxx.xxx;
deny all;
}
使用 yamlencode 怎么样?这只是一个例子:
set {
name = "server\\.resources"
value = yamlencode({
limits = {
cpu = "200m"
memory = "50Mi"
}
requests = {
cpu = "100m"
memory = "30Mi"
}
})
}