forked from oracle-terraform-modules/terraform-oci-oke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables-workers.tf
233 lines (200 loc) · 8.28 KB
/
variables-workers.tf
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Copyright (c) 2022, 2023 Oracle Corporation and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
#
# Cluster
#
variable "cluster_id" {
default = null
description = "An existing OKE cluster OCID when `create_cluster = false`."
type = string
}
variable "cluster_ca_cert" {
default = null
description = "Base64+PEM-encoded cluster CA certificate for unmanaged instance pools. Determined automatically when 'create_cluster' = true or 'cluster_id' is provided."
type = string
}
variable "cluster_dns" {
default = null
description = "Cluster DNS resolver IP address. Determined automatically when not set (recommended)."
type = string
}
#
# Worker pools
#
variable "worker_pools" {
default = {}
description = "Tuple of OKE worker pools where each key maps to the OCID of an OCI resource, and value contains its definition."
type = any
}
variable "worker_pool_mode" {
default = "node-pool"
description = "Default management mode for workers when unspecified on a pool."
type = string
validation {
condition = contains([
"node-pool",
"virtual-node-pool",
"instance",
"instance-pool",
"cluster-network"
], var.worker_pool_mode)
error_message = "Accepted values are node-pool, virtual-node-pool, instance, instance-pool, or cluster-network."
}
}
variable "worker_pool_size" {
default = 0
description = "Default size for worker pools when unspecified on a pool."
type = number
}
#
# Workers: network
#
variable "worker_is_public" {
default = false
description = "Whether to provision workers with public IPs allocated by default when unspecified on a pool."
type = bool
}
variable "worker_nsg_ids" {
default = []
description = "An additional list of network security group (NSG) IDs for node security. Combined with 'nsg_ids' specified on each pool."
type = list(string)
}
variable "pod_nsg_ids" {
default = []
description = "An additional list of network security group (NSG) IDs for pod security. Combined with 'pod_nsg_ids' specified on each pool."
type = list(string)
}
variable "kubeproxy_mode" {
default = "iptables"
description = "The mode in which to run kube-proxy when unspecified on a pool."
type = string
validation {
condition = contains(["iptables", "ipvs"], var.kubeproxy_mode)
error_message = "Accepted values are iptables or ipvs."
}
}
#
# Workers: instance
#
variable "worker_block_volume_type" {
default = "paravirtualized"
description = "Default block volume attachment type for Instance Configurations when unspecified on a pool."
type = string
validation {
condition = contains(["iscsi", "paravirtualized"], var.worker_block_volume_type)
error_message = "Accepted values are 'iscsi' or 'paravirtualized'."
}
}
variable "worker_node_labels" {
default = {}
description = "Default worker node labels. Merged with labels defined on each pool."
type = map(string)
}
variable "worker_node_metadata" {
default = {}
description = "Map of additional worker node instance metadata. Merged with metadata defined on each pool."
type = map(string)
}
variable "worker_image_id" {
default = null
description = "Default image for worker pools when unspecified on a pool."
type = string
}
variable "worker_image_type" {
default = "oke"
description = "Whether to use a platform, OKE, or custom image for worker nodes by default when unspecified on a pool. When custom is set, the worker_image_id must be specified."
type = string
validation {
condition = contains(["custom", "oke", "platform"], var.worker_image_type)
error_message = "Accepted values are custom, oke, platform"
}
}
variable "worker_image_os" {
default = "Oracle Linux"
description = "Default worker image operating system name when worker_image_type = 'oke' or 'platform' and unspecified on a pool."
type = string
}
variable "worker_image_os_version" {
default = "8"
description = "Default worker image operating system version when worker_image_type = 'oke' or 'platform' and unspecified on a pool."
type = string
}
variable "worker_shape" {
default = {
shape = "VM.Standard.E4.Flex",
ocpus = 2,
memory = 16,
boot_volume_size = 50
}
description = "Default shape of the created worker instance when unspecified on a pool."
type = map(any)
}
variable "worker_capacity_reservation_id" {
default = null
description = "The ID of the Compute capacity reservation the worker node will be launched under. See <a href=https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/reserve-capacity.htm>Capacity Reservations</a> for more information."
type = string
}
variable "worker_preemptible_config" {
default = {
enable = false,
is_preserve_boot_volume = false
}
description = "Default preemptible Compute configuration when unspecified on a pool. See <a href=https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengusingpreemptiblecapacity.htm>Preemptible Worker Nodes</a> for more information."
type = map(any)
}
variable "worker_cloud_init" {
default = []
description = "List of maps containing cloud init MIME part configuration for worker nodes. Merged with pool-specific definitions. See https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/cloudinit_config.html#part for expected schema of each element."
type = list(map(string))
}
variable "worker_disable_default_cloud_init" {
default = false
description = "Whether to disable the default OKE cloud init and only use the cloud init explicitly passed to the worker pool in 'worker_cloud_init'."
type = bool
}
variable "worker_volume_kms_key_id" {
default = null
description = "The ID of the OCI KMS key to be used as the master encryption key for Boot Volume and Block Volume encryption by default when unspecified on a pool."
type = string
}
variable "worker_pv_transit_encryption" {
default = false
description = "Whether to enable in-transit encryption for the data volume's paravirtualized attachment by default when unspecified on a pool."
type = bool
}
variable "max_pods_per_node" {
default = 31
description = "The default maximum number of pods to deploy per node when unspecified on a pool. Absolute maximum is 110. Ignored when when cni_type != 'npn'."
type = number
validation {
condition = var.max_pods_per_node > 0 && var.max_pods_per_node <= 110
error_message = "Must be between 1 and 110."
}
}
variable "platform_config" {
default = null
description = "Default platform_config for self-managed worker pools created with mode: 'instance', 'instance-pool', or 'cluster-network'. See <a href=https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/PlatformConfig>PlatformConfig</a> for more information."
type = object({
type = optional(string),
are_virtual_instructions_enabled = optional(bool),
is_access_control_service_enabled = optional(bool),
is_input_output_memory_management_unit_enabled = optional(bool),
is_measured_boot_enabled = optional(bool),
is_memory_encryption_enabled = optional(bool),
is_secure_boot_enabled = optional(bool),
is_symmetric_multi_threading_enabled = optional(bool),
is_trusted_platform_module_enabled = optional(bool),
numa_nodes_per_socket = optional(number),
percentage_of_cores_enabled = optional(bool),
})
}
variable "agent_config" {
default = null
description = "Default agent_config for self-managed worker pools created with mode: 'instance', 'instance-pool', or 'cluster-network'. See <a href=https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/InstanceAgentConfig for more information."
type = object({
are_all_plugins_disabled = bool,
is_management_disabled = bool,
is_monitoring_disabled = bool,
plugins_config = map(string),
})
}