Repository navigation
Expand file tree
/
Copy pathvariables.tf
More file actions
130 lines (116 loc) · 4.36 KB
/
Copy pathvariables.tf
File metadata and controls
130 lines (116 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
variable "cpu" {
type = string
default = "0.5"
description = <<EOF
The amount of CPU to request for the service (maps to resources.requests.cpu in the k8s deployment spec).
The k8s scheduler uses this value to decide which node to place the pod on.
You can specify CPU in cores (e.g. "0.5") or milliCPU (e.g. "500m").
By default, this is set to 0.5 CPU.
EOF
}
variable "max_cpu" {
type = string
default = ""
description = <<EOF
The maximum amount of CPU the service can use (maps to resources.limits.cpu in the k8s deployment spec).
If the service exceeds this limit, it will be throttled.
You can specify CPU in cores (e.g. "1") or milliCPU (e.g. "1000m").
By default, this is unset which means there is no CPU limit.
EOF
}
variable "memory" {
type = string
default = "512Mi"
description = <<EOF
The amount of memory to request for the service (maps to resources.requests.memory in the k8s deployment spec).
The k8s scheduler uses this value to decide which node to place the pod on.
Memory is measured in Mi (megabytes) or Gi (gigabytes).
By default, this is set to 512Mi (0.5Gi).
EOF
}
variable "max_memory" {
type = string
default = ""
description = <<EOF
The maximum amount of memory the service can use (maps to resources.limits.memory in the k8s deployment spec).
If the service exceeds this limit, it will be killed with an OOMKilled status.
Memory is measured in Mi (megabytes) or Gi (gigabytes).
By default, this is unset which means there is no memory limit.
EOF
}
variable "command" {
type = list(string)
default = []
description = <<EOF
This overrides the `CMD` specified in the image.
Specify a blank list to use the image's `CMD`.
Each token in the command is an item in the list.
For example, `echo "Hello World"` would be represented as ["echo", "\"Hello World\""].
EOF
}
variable "replicas" {
type = number
description = "The desired number of pod replicas to run."
default = 1
}
variable "container_port" {
type = number
default = 8080
description = <<EOF
This is the port that your container is listening and will get mapped to var.service_port for external communication.
By default, this is set to 8080.
You cannot bind to a port <1024 a you will get permission errors.
EOF
}
variable "service_port" {
type = number
default = 80
description = <<EOF
Other services on the network can reach this app via `<app_name>:<service_port>`.
`service_port` is mapped to `container_port`.
Specify 0 to disable network connectivity to this app.
EOF
}
variable "rolling_update_strategy" {
type = object({
max_surge = optional(string)
max_unavailable = optional(string)
})
default = {
max_surge = "1"
max_unavailable = "0"
}
description = <<EOF
The rolling update strategy for the Deployment.
The defaults (`max_surge = "1"`, `max_unavailable = "0"`) guarantee no reduction in serving capacity during a rollout, which (together with an attached Load Balancer's termination coordination) enables zero-downtime deploys.
Set to `null` to omit the strategy and use the Kubernetes default (25% surge / 25% unavailable).
EOF
}
variable "termination_grace_seconds" {
type = number
default = 30
description = <<EOF
The number of seconds Kubernetes waits after SIGTERM for the pod to shut down gracefully before force-killing it.
Increase for apps that need to finish in-flight work on shutdown (e.g. model servers draining long-running requests).
When an attached capability (e.g. a load balancer) supplies its own termination grace override, the larger of the two values is used.
By default, this is set to 30 (the Kubernetes default).
EOF
}
variable "image_url" {
type = string
default = ""
description = <<EOF
This allows you to override the image used for the application.
This removes management of build artifacts through Nullstone, but allows you to use pre-built artifacts managed externally.
If blank, Nullstone will create an image repository and provide management of images.
If you configure image_url, you can still use `nullstone deploy --version=<...>` to deploy a specific image tag.
EOF
}
variable "disable_security_group" {
type = bool
default = false
description = <<EOF
Set to true to disable the use of security groups for this app's pods.
This will eliminate the need for an ENI (which are limited per node).
EOF
}