Commit 76441cb3 by chenxx

1

1 parent 4c8a5eb4
terraform {
required_providers {
kubectl = {
source = "gavinbunney/kubectl"
version = "1.14.0"
}
}
}
module "deployment" {
# disable wait for all pods be ready.
#
......@@ -81,9 +72,9 @@ module "service" {
]
}
module "ingress" {
count = var.ingress_switch.switch == "on" ? 1 : 0
module "ingress" {
count = var.ingress_switch.switch == "on" ? 1 : 0
source = "./modules/ingress/kubernetes"
ingress_name = local.name
......@@ -102,18 +93,9 @@ module "ingress" {
}
data "kubernetes_service" "service" {
depends_on = [module.service]
metadata {
name = local.name
namespace = local.namespace
}
}
locals {
name = coalesce(var.name, "${var.walrus_metadata_service_name}")
namespace = coalesce(var.namespace, var.walrus_metadata_namespace_name)
}
......@@ -106,14 +106,20 @@ variable "restart_policy" {
# @label "chiose ingress switch on or off"
# @options ["on", "off"]
# @group "ingress"
# @group "Ingress"
variable "ingress_switch" {
type = object({
switch = optional(string)
path_type = optional(string, "ImplementationSpecific")
path = optional(string, "/")
path_type = optional(string)
path = optional(string)
domain_name = optional(string)
})
default = {
switch = "off"
path_type = "ImplementationSpecific"
path = "/"
domain_name = null
}
description = "choise ingress switch"
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!