Commit 42fc6ef9 by chenxx

update

1 parent 1551f562
...@@ -18,7 +18,7 @@ module "deployment" { ...@@ -18,7 +18,7 @@ module "deployment" {
# Use local paths to avoid accessing external networks # Use local paths to avoid accessing external networks
# This module comes from terraform registry "terraform-iaac/deployment/kubernetes 1.4.2" # This module comes from terraform registry "terraform-iaac/deployment/kubernetes 1.4.2"
source = "./modules/deployment/kubernetes" source = "./modules/deployment/kubernetes"
name = local.name name = local.name
namespace = local.namespace namespace = local.namespace
...@@ -31,24 +31,53 @@ module "deployment" { ...@@ -31,24 +31,53 @@ module "deployment" {
limit_memory = var.limit_memory == "" ? null : var.limit_memory limit_memory = var.limit_memory == "" ? null : var.limit_memory
} }
env = var.env env = var.env
readiness_probe = {
http_get = {
path = "/"
port = var.probe_http_port
scheme = "HTTP"
}
success_threshold = 1
failure_threshold = 3
initial_delay_seconds = 10
period_seconds = 30
timeout_seconds = 3
}
volume_host_path = [
{
volume_name = var.volume_logs
path_on_node = "/data/java_log"
},
{
volume_name = var.app_path
path_on_node = "/app/soft/java_project"
}
]
} }
module "service" { module "service" {
# Use local paths to avoid accessing external networks # Use local paths to avoid accessing external networks
# This module comes from terraform registry "terraform-iaac/service/kubernetes 1.0.4" # This module comes from terraform registry "terraform-iaac/service/kubernetes 1.0.4"
source = "./modules/service/kubernetes" source = "./modules/service/kubernetes"
app_name = local.name app_name = local.name
app_namespace = local.namespace app_namespace = local.namespace
type = "NodePort" type = "NodePort"
port_mapping = [for p in var.ports : port_mapping = [
{ for p in var.ports :
name = "port-${p}" {
internal_port = p name = "port-${p}"
external_port = p internal_port = p
protocol = "TCP" external_port = p
}] protocol = "TCP"
}
]
} }
data "kubernetes_service" "service" { data "kubernetes_service" "service" {
......
...@@ -79,3 +79,23 @@ variable "walrus_metadata_namespace_name" { ...@@ -79,3 +79,23 @@ variable "walrus_metadata_namespace_name" {
description = "Walrus metadata namespace name." description = "Walrus metadata namespace name."
default = "" default = ""
} }
# @label "probe_port"
# @group "Advanced"
variable "probe_http_port" {
description = "(Optional)http port for probe"
default = "80"
type = string
}
# @label "app_logs_path"
# @group "Advanced"
variable "volume_logs" {
default = "/data/java_log"
}
# @label "app_path"
# @group "Advanced"
variable "app_path" {
default = "/app/soft/java_project"
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!