Commit 20397683 by chenxx

update volume mount and restart policy

1 parent 18285afe
...@@ -24,6 +24,7 @@ module "deployment" { ...@@ -24,6 +24,7 @@ module "deployment" {
namespace = local.namespace namespace = local.namespace
image = var.image image = var.image
replicas = var.replicas replicas = var.replicas
restart_policy = var.restart_policy
resources = { resources = {
request_cpu = var.request_cpu == "" ? null : var.request_cpu request_cpu = var.request_cpu == "" ? null : var.request_cpu
limit_cpu = var.limit_cpu == "" ? null : var.limit_cpu limit_cpu = var.limit_cpu == "" ? null : var.limit_cpu
...@@ -47,12 +48,23 @@ module "deployment" { ...@@ -47,12 +48,23 @@ module "deployment" {
volume_host_path = [ volume_host_path = [
{ {
volume_name = var.volume_logs volume_name = var.app_log_path_volume_name
path_on_node = "/data/java_log" path_on_node = var.app_log_path
}, },
{ {
volume_name = var.app_path volume_name = var.app_path_volume_name
path_on_node = "/app/soft/java_project" path_on_node = var.app_path
}
]
volume_mount = [
{
mount_path = var.app_path
volume_name = var.app_path_volume_name
},
{
mount_path = var.app_log_path
volume_name = var.app_log_path_volume_name
} }
] ]
......
...@@ -89,13 +89,38 @@ variable "probe_http_port" { ...@@ -89,13 +89,38 @@ variable "probe_http_port" {
type = string type = string
} }
# @label "app_logs_path" # @label "应用日志挂载卷名"
# @group "Advanced" # @group "Advanced"
variable "volume_logs" { variable "app_log_path_volume_name" {
default = "volume-logs" type = string
default = "app_log_path"
}
# @label "应用日志路径"
# @group "Advanced"
variable "app_log_path" {
type = string
default = "/data/java_log"
} }
# @label "app_path"
# @label "应用挂载卷名"
# @group "Advanced"
variable "app_path_volume_name" {
type = string
default = "app_path"
}
# @label "应用路径"
# @group "Advanced" # @group "Advanced"
variable "app_path" { variable "app_path" {
default = "app-path" type = string
default = "/app/soft/java_project"
}
# @label "重启策略"
# @group "Advanced"
variable "restart_policy" {
type = string
description = "Restart policy for all containers within the pod. One of Always, OnFailure, Never"
default = "Never"
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!