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 42fc6ef9
authored
Oct 26, 2023
by
chenxx
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update
1 parent
1551f562
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
9 deletions
main.tf
variables.tf
main.tf
View file @
42fc6ef
...
@@ -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" {
...
...
variables.tf
View file @
42fc6ef
...
@@ -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"
}
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