Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
terraform_module
/
standard_webservice
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 20397683
authored
Oct 26, 2023
by
chenxx
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update volume mount and restart policy
1 parent
18285afe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
14 deletions
main.tf
variables.tf
main.tf
View file @
2039768
...
@@ -20,11 +20,12 @@ module "deployment" {
...
@@ -20,11 +20,12 @@ module "deployment" {
# 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
image = var.image
image = var.image
replicas = var.replicas
replicas = var.replicas
resources = {
restart_policy = var.restart_policy
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
request_memory = var.request_memory == "" ? null : var.request_memory
request_memory = var.request_memory == "" ? null : var.request_memory
...
@@ -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
}
}
]
]
...
...
variables.tf
View file @
2039768
...
@@ -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 "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"
# @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"
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment