Commit c2d986b1 by chenxx

add affinity and update limit cpu

1 parent 0bfc212a
...@@ -58,6 +58,9 @@ module "deployment" { ...@@ -58,6 +58,9 @@ module "deployment" {
ip = host_list.ip ip = host_list.ip
} }
] ]
#affinity: default=true
prevent_deploy_on_the_same_node = var.prevent_deploy_on_the_same_node
} }
module "service" { module "service" {
...@@ -87,11 +90,11 @@ module "ingress" { ...@@ -87,11 +90,11 @@ module "ingress" {
ingress_name = local.name ingress_name = local.name
service_namespace = local.namespace service_namespace = local.namespace
service_name = local.name service_name = local.name
# annotations = { # annotations = {
# "nginx.ingress.kubernetes.io/proxy-send-timeout" = "360" # "nginx.ingress.kubernetes.io/proxy-send-timeout" = "360"
# "nginx.ingress.kubernetes.io/proxy-read-timeout" = "360" # "nginx.ingress.kubernetes.io/proxy-read-timeout" = "360"
# } # }
annotations = var.annotations annotations = var.annotations
rule = [ rule = [
{ {
......
...@@ -195,8 +195,9 @@ variable "rolling_update" { ...@@ -195,8 +195,9 @@ variable "rolling_update" {
variable "wait_for_rollout" { variable "wait_for_rollout" {
default = true default = true
} }
variable "prevent_deploy_on_the_same_node" { variable "prevent_deploy_on_the_same_node" {
description = "Pod pod_anti_affinity rule, which prevents deploy same pod on one node." description = "Pod pod_anti_affinity rule, which prevents deploy same pod on one node."
type = bool type = bool
default = false default = true
} }
\ No newline at end of file \ No newline at end of file
...@@ -77,6 +77,7 @@ components: ...@@ -77,6 +77,7 @@ components:
- 0.5 - 0.5
- 1 - 1
- 2 - 2
- ""
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: Resources group: Resources
...@@ -110,6 +111,7 @@ components: ...@@ -110,6 +111,7 @@ components:
- 1 - 1
- 2 - 2
- 3 - 3
- ""
nullable: true nullable: true
x-walrus-ui: x-walrus-ui:
group: Resources group: Resources
...@@ -286,11 +288,26 @@ components: ...@@ -286,11 +288,26 @@ components:
title: Annotations title: Annotations
type: object type: object
description: (Optional) Custom Annotations description: (Optional) Custom Annotations
default: {}
nullable: true nullable: true
additionalProperties:
type: object
x-walrus-ui:
colSpan: 12
x-walrus-ui: x-walrus-ui:
colSpan: 12 colSpan: 12
group: Advanced group: Advanced
order: 19 order: 19
prevent_deploy_on_the_same_node:
title: Prevent Deploy On The Same Node
type: boolean
description: Pod pod_anti_affinity rule, which prevents deploy same pod
on one node.
default: false
nullable: true
x-walrus-ui:
group: Advanced
order: 20
x-walrus-ui: x-walrus-ui:
groupOrder: groupOrder:
- Basic - Basic
......
...@@ -150,7 +150,17 @@ variable "hosts" { ...@@ -150,7 +150,17 @@ variable "hosts" {
} }
# @label "annotations"
# @group "advance"
variable "annotations" { variable "annotations" {
type = map(any)
description = "(Optional) Custom Annotations" description = "(Optional) Custom Annotations"
default = null default = {}
}
# @label "affinity"
# @group "advance"
variable "prevent_deploy_on_the_same_node" {
description = "Pod pod_anti_affinity rule, which prevents deploy same pod on one node."
type = bool
default = false
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!