Kubernetes
Example Usage
resource "e2e_kubernetes" "kubernetes1" {
name = "kubernetes_cluster_v1"
version = "1.25" //Just an example
project_id = 30000 //Just an example
location = "Delhi"
vpc_id = "10001" //Just an example
node_pools {
name = "node_pool_1"
specs_name = "C3.8GB"
node_pool_type = "Static"
worker_node = 2
}
node_pools {
name = "node_pool_2"
specs_name = "C3.8GB"
node_pool_type = "Autoscale"
min_vms = 2
max_vms = 4
scheduled_dict {
worker {
scheduled_policies {
upscale_cardinality = 4
upscale_recurrence = "0 12 * * *"
downscale_cardinality = 2
downscale_recurrence = "0 2 * * *"
}
}
}
}
node_pools {
name = "node-pool_v3"
specs_name = "C3.8GB"
node_pool_type = "Autoscale"
min_vms = 2
max_vms = 4
scheduled_dict {
worker {
scheduled_policies {
upscale_cardinality = 4
upscale_recurrence = "0 12 * * *"
downscale_cardinality = 2
downscale_recurrence = "0 2 * * *"
}
}
}
elasticity_dict {
worker {
period_number = 3
parameter = "NETWORK_TRAFFIC"
policy_parameter_type = "Custom"
elasticity_policies {
operator = ">"
value = 60
period = 10
watch_period = 3
cooldown = 150
}
elasticity_policies {
operator = "<"
value = 30
period = 10
watch_period = 3
cooldown = 150
}
}
}
}
}
Schema
Required
name(String) The name of the Kubernetes servicenode_pools(Block List, Min: 1) List of worker node pools (see below for nested schema)project_id(Number) ID of the project. It should be uniqueversion(String) Version of the Kubernetes servicevpc_id(String) VPC ID of the Kubernetes service
Optional
location(String) Location of the block storage
Read-Only
created_at(String) Creation time of the Kubernetes Serviceid(String) The ID of this resource.sku_id(String) SKU ID of the Kubernetes serviceslug_name(String) Slug name of the Kubernetes servicestatus(String) This is the status of the Kubernetes Service, only to get the status from my account.
Nested Schema for node_pools
Required:
name(String) Name of the worker node poolnode_pool_type(String) Its value can be Autoscale or Staticspecs_name(String) Specs name of the worker node pool
Optional:
elasticity_dict(Block List) Elasticity dictionary for the worker node pool (Only In case of Autoscale Node Pool Type) (see below for nested schema)max_vms(Number) Maximum number of virtual machines (Only In case of Autoscale Node Pool Type)min_vms(Number) Minimum number of virtual machines (Only In case of Autoscale Node Pool Type)node_pool_size(Number) Only to be used during updation if you want to resize a node pool.scheduled_dict(Block List) Scheduled dictionary for the worker node pool (Only In case of Autoscale Node Pool Type) (see below for nested schema)worker_node(Number) Number of worker nodes in the pool (In case of Static Node Pool only)
Read-Only:
cardinality(Number) Cardinality computed from min_vms during creationcustom_param_name(String) Custom parameter name for the worker node poolcustom_param_value(String) Custom parameter value for the worker node poolpolicy_type(String) Policy type for the worker node poolservice_id(String) Services ID of the worker node poolsku_id(String) SKU ID of the worker node poolslug_name(String) Slug name of the worker node pool
Nested Schema for node_pools.elasticity_dict
Optional:
worker(Block List) Worker settings in the elasticity dictionary (see below for nested schema)
Nested Schema for node_pools.elasticity_dict.worker
Required:
elasticity_policies(Block List, Min: 1) List of elasticity policies (see below for nested schema)period_number(Number) Period numberpolicy_parameter_type(String) Its value can be Default or Custom. If it is custom then you must provide the parameter field.
Optional:
parameter(String) Parameter (e.g., CPU, Memory)
Nested Schema for node_pools.elasticity_dict.worker.elasticity_policies
Required:
cooldown(Number) Cooldownoperator(String) Operator for adding worker (e.g., >, >=)period(Number) Periodvalue(Number) Value for adding workerwatch_period(Number) Period Number
Nested Schema for node_pools.scheduled_dict
Optional:
worker(Block List) Worker settings in the scheduled dictionary (see below for nested schema)
Nested Schema for node_pools.scheduled_dict.worker
Required:
scheduled_policies(Block List, Min: 1) (see below for nested schema)
Nested Schema for node_pools.scheduled_dict.worker.scheduled_policies
Required:
downscale_cardinality(Number) The cardinality for downscalingdownscale_recurrence(String) The recurrence timing for downscalingupscale_cardinality(Number) The cardinality for upscalingupscale_recurrence(String) The recurrence timing for upscaling