Commit e5eec7d4 by chenxx

change ui 2

1 parent 2f3ba404
...@@ -28,15 +28,13 @@ ...@@ -28,15 +28,13 @@
| Name | Description | Type | Default | Required | | 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_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_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_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_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_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_namespace"></a> [namespace](#input\_namespace) | Namespace to deploy. Auto-generated if empty. | `string` | n/a | yes |
| <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_port"></a> [port](#input\_port) | Service ports to expose | `string` | `"7777"` | no | | <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_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 | | <a name="input_probe_http_port"></a> [probe\_http\_port](#input\_probe\_http\_port) | (Optional)http port for probe | `string` | `"7777"` | no |
......
...@@ -82,6 +82,8 @@ module "service" { ...@@ -82,6 +82,8 @@ module "service" {
} }
module "ingress" { module "ingress" {
count = var.ingress_switch.switch == "on" ? 1 : 0
source = "./modules/ingress/kubernetes" source = "./modules/ingress/kubernetes"
ingress_name = local.name ingress_name = local.name
...@@ -90,10 +92,10 @@ module "ingress" { ...@@ -90,10 +92,10 @@ module "ingress" {
rule = [ rule = [
{ {
domain = var.domain_name domain = var.ingress_switch.domain_name
external_port = var.port // Service port external_port = var.port // Service port
path = var.path path = var.ingress_switch.path
path_type = var.path_type path_type = var.ingress_switch.path_type
} }
] ]
...@@ -112,4 +114,6 @@ data "kubernetes_service" "service" { ...@@ -112,4 +114,6 @@ data "kubernetes_service" "service" {
locals { locals {
name = coalesce(var.name, "${var.walrus_metadata_service_name}") name = coalesce(var.name, "${var.walrus_metadata_service_name}")
namespace = coalesce(var.namespace, var.walrus_metadata_namespace_name) namespace = coalesce(var.namespace, var.walrus_metadata_namespace_name)
} }
...@@ -8,22 +8,24 @@ components: ...@@ -8,22 +8,24 @@ components:
required: required:
- domain_name - domain_name
- image - image
- ingress_switch
- name
- path
properties: properties:
image: image:
title: Image title: Image
type: string type: string
description: Docker image name description: Docker image name
x-walrus-ui: x-walrus-ui:
group: 基础 group: Basic
order: 1 order: 1
name: name:
title: Name title: Name
type: string type: string
description: Name of the deployment resource. Auto-generated if empty. description: Name of the deployment resource. Auto-generated if empty.
nullable: true
x-walrus-ui: x-walrus-ui:
group: 基础 group: Basic
order: 3 order: 2
port: port:
title: Port title: Port
type: string type: string
...@@ -31,8 +33,8 @@ components: ...@@ -31,8 +33,8 @@ components:
default: "7777" default: "7777"
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
order: 4 order: 3
env: env:
title: Env title: Env
type: object type: object
...@@ -43,8 +45,8 @@ components: ...@@ -43,8 +45,8 @@ components:
type: string type: string
x-walrus-ui: x-walrus-ui:
colSpan: 12 colSpan: 12
group: 高级 group: Advanced
order: 5 order: 4
replicas: replicas:
title: Replicas title: Replicas
type: number type: number
...@@ -52,44 +54,72 @@ components: ...@@ -52,44 +54,72 @@ components:
default: 1 default: 1
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
order: 6 order: 5
request_cpu: request_cpu:
title: Request Cpu title: Request Cpu
type: string type: string
description: CPU request. e.g. 0.5, 1, 2 description: CPU request. e.g. 0.5, 1, 2
default: "0.1" default: "0.1"
enum:
- 0.1
- 0.2
- 0.3
- 0.5
- 1
- 2
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 资源配额 group: Resource
order: 7 order: 6
request_memory: request_memory:
title: Request Memory title: Request Memory
type: string type: string
description: Memory request. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi description: Memory request. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi
default: 128Mi default: 128Mi
enum:
- 128Mi
- 512Mi
- 1Gi
- 2Gi
- 3Gi
- 4Gi
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 资源配额 group: Resource
order: 8 order: 7
limit_cpu: limit_cpu:
title: Limit Cpu title: Limit Cpu
type: string type: string
description: CPU limit. e.g. 0.5, 1, 2 description: CPU limit. e.g. 0.5, 1, 2
default: "0.5" default: "0.5"
enum:
- 0.1
- 0.2
- 0.3
- 0.5
- 1
- 2
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 资源配额 group: Resource
order: 9 order: 8
limit_memory: limit_memory:
title: Limit Memory title: Limit Memory
type: string type: string
description: Memory limit. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi description: Memory limit. e.g. 128Mi, 512Mi, 1Gi, 2Gi, 4Gi
default: 128Mi default: 128Mi
enum:
- 128Mi
- 512Mi
- 1Gi
- 2Gi
- 3Gi
- 4Gi
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 资源配额 group: Resource
order: 10 order: 9
probe_http_port: probe_http_port:
title: Probe Http Port title: Probe Http Port
type: string type: string
...@@ -97,8 +127,8 @@ components: ...@@ -97,8 +127,8 @@ components:
default: "7777" default: "7777"
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
order: 11 order: 10
probe_http_path: probe_http_path:
title: Probe Http Path title: Probe Http Path
type: string type: string
...@@ -106,8 +136,8 @@ components: ...@@ -106,8 +136,8 @@ components:
default: / default: /
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
order: 12 order: 11
restart_policy: restart_policy:
title: Restart Policy title: Restart Policy
type: string type: string
...@@ -116,42 +146,67 @@ components: ...@@ -116,42 +146,67 @@ components:
default: Always default: Always
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
order: 13 order: 12
path_type: ingress_switch:
title: Path Type title: Ingress Switch
type: string type: object
description: Path type for ingress rule description: choise ingress switch
default: ImplementationSpecific required:
nullable: true - domain_name
x-walrus-ui: - path
group: ingress properties:
order: 14 domain_name:
path: title: Domain Name
title: Path type: string
type: string x-walrus-ui:
description: 访问路径 order: 4
default: / showIf: switch=on
nullable: true path:
x-walrus-ui: defalut: /
group: ingress description: 访问路径。例子:/,/aaa_project
order: 15 title: Path
domain_name: type: string
title: Domain Name x-walrus-ui:
type: string group: Ingress
description: 域名 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: x-walrus-ui:
group: ingress colSpan: 12
order: 2 group: Ingress
order: 13
namespace: namespace:
title: Namespace title: Namespace
type: string type: string
description: Namespace to deploy. Auto-generated if empty. description: Namespace to deploy. Auto-generated if empty.
default: ""
nullable: true
x-walrus-ui: x-walrus-ui:
group: 基础 group: Basic
order: 16 order: 17
walrus_metadata_service_name: walrus_metadata_service_name:
title: Walrus Metadata Service Name title: Walrus Metadata Service Name
type: string type: string
...@@ -159,9 +214,9 @@ components: ...@@ -159,9 +214,9 @@ components:
default: "" default: ""
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
hidden: true hidden: true
order: 16 order: 18
walrus_metadata_namespace_name: walrus_metadata_namespace_name:
title: Walrus Metadata Namespace Name title: Walrus Metadata Namespace Name
type: string type: string
...@@ -169,13 +224,12 @@ components: ...@@ -169,13 +224,12 @@ components:
default: "" default: ""
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: 高级 group: Advanced
hidden: true hidden: true
order: 17 order: 19
null: null
x-walrus-ui: x-walrus-ui:
groupOrder: groupOrder:
- 基础 - Basic
- 高级 - Resource
- 资源配额 - Advanced
- ingress - Ingress
...@@ -104,30 +104,17 @@ variable "restart_policy" { ...@@ -104,30 +104,17 @@ variable "restart_policy" {
} }
# @label "path_type" # @label "chiose ingress switch on or off"
# @options ["ImplementationSpecific","Exact","Prefix"] # @options ["on", "off"]
# @group "ingress" # @group "ingress"
# @showif "ingress=true" variable "ingress_switch" {
variable "path_type" { type = object({
type = string switch = optional(string, "off")
description = "Path type for ingress rule" path_type = optional(string, "ImplementationSpecific")
default = "ImplementationSpecific" path = string
} domain_name = string
})
# @label "path" description = "choise ingress switch"
# @group "ingress"
# @showif "ingress=true"
variable "path" {
type = string
description = "访问路径"
}
# @label "domain name"
# @group "Basic"
# @showif "ingress=true"
variable "domain_name" {
type = string
description = "域名"
} }
# @label "Namespace" # @label "Namespace"
...@@ -135,7 +122,6 @@ variable "domain_name" { ...@@ -135,7 +122,6 @@ variable "domain_name" {
variable "namespace" { variable "namespace" {
type = string type = string
description = "Namespace to deploy. Auto-generated if empty." description = "Namespace to deploy. Auto-generated if empty."
default = ""
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!