Commit 20397683 by chenxx

update volume mount and restart policy

1 parent 18285afe
......@@ -20,11 +20,12 @@ module "deployment" {
# This module comes from terraform registry "terraform-iaac/deployment/kubernetes 1.4.2"
source = "./modules/deployment/kubernetes"
name = local.name
namespace = local.namespace
image = var.image
replicas = var.replicas
resources = {
name = local.name
namespace = local.namespace
image = var.image
replicas = var.replicas
restart_policy = var.restart_policy
resources = {
request_cpu = var.request_cpu == "" ? null : var.request_cpu
limit_cpu = var.limit_cpu == "" ? null : var.limit_cpu
request_memory = var.request_memory == "" ? null : var.request_memory
......@@ -47,12 +48,23 @@ module "deployment" {
volume_host_path = [
{
volume_name = var.volume_logs
path_on_node = "/data/java_log"
volume_name = var.app_log_path_volume_name
path_on_node = var.app_log_path
},
{
volume_name = var.app_path
path_on_node = "/app/soft/java_project"
volume_name = var.app_path_volume_name
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" {
type = string
}
# @label "app_logs_path"
# @label "应用日志挂载卷名"
# @group "Advanced"
variable "volume_logs" {
default = "volume-logs"
variable "app_log_path_volume_name" {
type = string
default = "app_log_path"
}
# @label "app_path"
# @label "应用日志路径"
# @group "Advanced"
variable "app_log_path" {
type = string
default = "/data/java_log"
}
# @label "应用挂载卷名"
# @group "Advanced"
variable "app_path_volume_name" {
type = string
default = "app_path"
}
# @label "应用路径"
# @group "Advanced"
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!