Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
terraform_module
/
lighttpd_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 e5eec7d4
authored
Jan 10, 2024
by
chenxx
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
change ui 2
1 parent
2f3ba404
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
92 deletions
README.md
main.tf
schema.yaml
variables.tf
README.md
View file @
e5eec7d
...
...
@@ -28,15 +28,13 @@
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
|
<a
name=
"input_domain_name"
></a>
[
domain\_name
](
#input\_domain\_name
)
| 域名 |
`string`
| n/a | yes |
|
<a
name=
"input_env"
></a>
[
env
](
#input\_env
)
| Name and value pairs to set as the environment variables |
`map(string)`
|
`{}`
| no |
|
<a
name=
"input_image"
></a>
[
image
](
#input\_image
)
| Docker image name |
`string`
| n/a | yes |
|
<a
name=
"input_ingress_switch"
></a>
[
ingress\_switch
](
#input\_ingress\_switch
)
| choise ingress switch |
<pre>
object({
<br>
switch = optional(string, "off")
<br>
path_type = optional(string, "ImplementationSpecific")
<br>
path = string
<br>
domain_name = string
<br>
})
</pre>
| n/a | yes |
|
<a
name=
"input_limit_cpu"
></a>
[
limit\_cpu
](
#input\_limit\_cpu
)
| CPU limit. e.g. 0.5, 1, 2 |
`string`
|
`"0.5"`
| no |
|
<a
name=
"input_limit_memory"
></a>
[
limit\_memory
](
#input\_limit\_memory
)
| Memory limit. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi |
`string`
|
`"128Mi"`
| no |
|
<a
name=
"input_name"
></a>
[
name
](
#input\_name
)
| Name of the deployment resource. Auto-generated if empty. |
`string`
| n/a | yes |
|
<a
name=
"input_namespace"
></a>
[
namespace
](
#input\_namespace
)
| Namespace to deploy. Auto-generated if empty. |
`string`
|
`""`
| no |
|
<a
name=
"input_path"
></a>
[
path
](
#input\_path
)
| 访问路径 |
`string`
| n/a | yes |
|
<a
name=
"input_path_type"
></a>
[
path\_type
](
#input\_path\_type
)
| Path type for ingress rule |
`string`
|
`"ImplementationSpecific"`
| no |
|
<a
name=
"input_namespace"
></a>
[
namespace
](
#input\_namespace
)
| Namespace to deploy. Auto-generated if empty. |
`string`
| n/a | yes |
|
<a
name=
"input_port"
></a>
[
port
](
#input\_port
)
| Service ports to expose |
`string`
|
`"7777"`
| no |
|
<a
name=
"input_probe_http_path"
></a>
[
probe\_http\_path
](
#input\_probe\_http\_path
)
| (Optional)http path for probe |
`string`
|
`"/"`
| no |
|
<a
name=
"input_probe_http_port"
></a>
[
probe\_http\_port
](
#input\_probe\_http\_port
)
| (Optional)http port for probe |
`string`
|
`"7777"`
| no |
...
...
main.tf
View file @
e5eec7d
...
...
@@ -82,6 +82,8 @@ module "service" {
}
module "ingress" {
count = var.ingress_switch.switch == "on" ? 1 : 0
source = "./modules/ingress/kubernetes"
ingress_name = local.name
...
...
@@ -90,10 +92,10 @@ module "ingress" {
rule = [
{
domain = var.domain_name
domain = var.
ingress_switch.
domain_name
external_port = var.port // Service port
path = var.path
path_type = var.path_type
path = var.
ingress_switch.
path
path_type = var.
ingress_switch.
path_type
}
]
...
...
@@ -112,4 +114,6 @@ data "kubernetes_service" "service" {
locals {
name = coalesce(var.name, "${var.walrus_metadata_service_name}")
namespace = coalesce(var.namespace, var.walrus_metadata_namespace_name)
}
schema.yaml
View file @
e5eec7d
...
...
@@ -8,22 +8,24 @@ components:
required
:
-
domain_name
-
image
-
ingress_switch
-
name
-
path
properties
:
image
:
title
:
Image
type
:
string
description
:
Docker image name
x-walrus-ui
:
group
:
基础
group
:
Basic
order
:
1
name
:
title
:
Name
type
:
string
description
:
Name of the deployment resource. Auto-generated if empty.
nullable
:
true
x-walrus-ui
:
group
:
基础
order
:
3
group
:
Basic
order
:
2
port
:
title
:
Port
type
:
string
...
...
@@ -31,8 +33,8 @@ components:
default
:
"
7777"
nullable
:
true
x-walrus-ui
:
group
:
高级
order
:
4
group
:
Advanced
order
:
3
env
:
title
:
Env
type
:
object
...
...
@@ -43,8 +45,8 @@ components:
type
:
string
x-walrus-ui
:
colSpan
:
12
group
:
高级
order
:
5
group
:
Advanced
order
:
4
replicas
:
title
:
Replicas
type
:
number
...
...
@@ -52,44 +54,72 @@ components:
default
:
1
nullable
:
true
x-walrus-ui
:
group
:
高级
order
:
6
group
:
Advanced
order
:
5
request_cpu
:
title
:
Request Cpu
type
:
string
description
:
CPU request. e.g. 0.5, 1, 2
default
:
"
0.1"
enum
:
-
0.1
-
0.2
-
0.3
-
0.5
-
1
-
2
nullable
:
true
x-walrus-ui
:
group
:
资源配额
order
:
7
group
:
Resource
order
:
6
request_memory
:
title
:
Request Memory
type
:
string
description
:
Memory request. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi
default
:
128Mi
enum
:
-
128Mi
-
512Mi
-
1Gi
-
2Gi
-
3Gi
-
4Gi
nullable
:
true
x-walrus-ui
:
group
:
资源配额
order
:
8
group
:
Resource
order
:
7
limit_cpu
:
title
:
Limit Cpu
type
:
string
description
:
CPU limit. e.g. 0.5, 1, 2
default
:
"
0.5"
enum
:
-
0.1
-
0.2
-
0.3
-
0.5
-
1
-
2
nullable
:
true
x-walrus-ui
:
group
:
资源配额
order
:
9
group
:
Resource
order
:
8
limit_memory
:
title
:
Limit Memory
type
:
string
description
:
Memory limit. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi
default
:
128Mi
enum
:
-
128Mi
-
512Mi
-
1Gi
-
2Gi
-
3Gi
-
4Gi
nullable
:
true
x-walrus-ui
:
group
:
资源配额
order
:
10
group
:
Resource
order
:
9
probe_http_port
:
title
:
Probe Http Port
type
:
string
...
...
@@ -97,8 +127,8 @@ components:
default
:
"
7777"
nullable
:
true
x-walrus-ui
:
group
:
高级
order
:
1
1
group
:
Advanced
order
:
1
0
probe_http_path
:
title
:
Probe Http Path
type
:
string
...
...
@@ -106,8 +136,8 @@ components:
default
:
/
nullable
:
true
x-walrus-ui
:
group
:
高级
order
:
1
2
group
:
Advanced
order
:
1
1
restart_policy
:
title
:
Restart Policy
type
:
string
...
...
@@ -116,42 +146,67 @@ components:
default
:
Always
nullable
:
true
x-walrus-ui
:
group
:
高级
order
:
13
path_type
:
title
:
Path Type
type
:
string
description
:
Path type for ingress rule
default
:
ImplementationSpecific
nullable
:
true
x-walrus-ui
:
group
:
ingress
order
:
14
path
:
title
:
Path
type
:
string
description
:
访问路径
default
:
/
nullable
:
true
x-walrus-ui
:
group
:
ingress
order
:
15
domain_name
:
title
:
Domain Name
type
:
string
description
:
域名
group
:
Advanced
order
:
12
ingress_switch
:
title
:
Ingress Switch
type
:
object
description
:
choise ingress switch
required
:
-
domain_name
-
path
properties
:
domain_name
:
title
:
Domain Name
type
:
string
x-walrus-ui
:
order
:
4
showIf
:
switch=on
path
:
defalut
:
/
description
:
访问路径。例子:/,/aaa_project
title
:
Path
type
:
string
x-walrus-ui
:
group
:
Ingress
order
:
3
showIf
:
switch=on
path_type
:
default
:
ImplementationSpecific
description
:
一般选择 ImplementationSpecific
enum
:
-
ImplementationSpecific
-
Exact
-
Prefix
nullable
:
true
title
:
Path Type
type
:
string
x-walrus-ui
:
group
:
Ingress
order
:
2
showIf
:
switch=on
switch
:
default
:
"
off"
enum
:
-
"
off"
-
"
on"
nullable
:
true
title
:
Switch
type
:
string
x-walrus-ui
:
group
:
Ingress
order
:
1
x-walrus-ui
:
group
:
ingress
order
:
2
colSpan
:
12
group
:
Ingress
order
:
13
namespace
:
title
:
Namespace
type
:
string
description
:
Namespace to deploy. Auto-generated if empty.
default
:
"
"
nullable
:
true
x-walrus-ui
:
group
:
基础
order
:
1
6
group
:
Basic
order
:
1
7
walrus_metadata_service_name
:
title
:
Walrus Metadata Service Name
type
:
string
...
...
@@ -159,9 +214,9 @@ components:
default
:
"
"
nullable
:
true
x-walrus-ui
:
group
:
高级
group
:
Advanced
hidden
:
true
order
:
1
6
order
:
1
8
walrus_metadata_namespace_name
:
title
:
Walrus Metadata Namespace Name
type
:
string
...
...
@@ -169,13 +224,12 @@ components:
default
:
"
"
nullable
:
true
x-walrus-ui
:
group
:
高级
group
:
Advanced
hidden
:
true
order
:
17
null
:
null
order
:
19
x-walrus-ui
:
groupOrder
:
-
基础
-
高级
-
资源配额
-
i
ngress
-
Basic
-
Resource
-
Advanced
-
I
ngress
variables.tf
View file @
e5eec7d
...
...
@@ -104,30 +104,17 @@ variable "restart_policy" {
}
# @label "
path_type
"
# @options ["
ImplementationSpecific","Exact","Prefix
"]
# @label "
chiose ingress switch on or off
"
# @options ["
on", "off
"]
# @group "ingress"
# @showif "ingress=true"
variable "path_type" {
type = string
description = "Path type for ingress rule"
default = "ImplementationSpecific"
}
# @label "path"
# @group "ingress"
# @showif "ingress=true"
variable "path" {
type = string
description = "访问路径"
}
# @label "domain name"
# @group "Basic"
# @showif "ingress=true"
variable "domain_name" {
type = string
description = "域名"
variable "ingress_switch" {
type = object({
switch = optional(string, "off")
path_type = optional(string, "ImplementationSpecific")
path = string
domain_name = string
})
description = "choise ingress switch"
}
# @label "Namespace"
...
...
@@ -135,7 +122,6 @@ variable "domain_name" {
variable "namespace" {
type = string
description = "Namespace to deploy. Auto-generated if empty."
default = ""
}
...
...
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