Commit 5f6e5a92 by chenxx

update 6

1 parent 94414503
......@@ -51,7 +51,15 @@ module "deployment" {
]
#domian map
host_aliases = var.hosts
host_aliases = [
for host_list in var.hosts : [
for h in host_list.hostname :
{
hostname = h,
ip = ip
}
]
]
}
......@@ -77,7 +85,7 @@ module "service" {
}
module "ingress" {
count = var.ingress_switch.switch == "on" ? 1 : 0
count = var.ingress_switch.switch == "on" ? 1 : 0
source = "./modules/ingress/kubernetes"
ingress_name = local.name
......@@ -87,9 +95,11 @@ module "ingress" {
rule = [
{
domain = var.ingress_switch.domain_name
external_port = var.ports[0] // Service port
path = var.ingress_switch.path
path_type = var.ingress_switch.path_type
external_port = var.ports[
0
] // Service port
path = var.ingress_switch.path
path_type = var.ingress_switch.path_type
}
]
......
......@@ -145,6 +145,6 @@ variable "ingress_switch" {
# @group "Advanced"
variable "hosts" {
type = list(object({ hostname = list(string), ip = string }))
description = "(Optional) Add /etc/hosts records to pods"
description = "(Optional) host aliases 手动配置域名到hosts"
default = []
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!