Skip to main content

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 service
  • node_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 unique
  • version (String) Version of the Kubernetes service
  • vpc_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 Service
  • id (String) The ID of this resource.
  • sku_id (String) SKU ID of the Kubernetes service
  • slug_name (String) Slug name of the Kubernetes service
  • status (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 pool
  • node_pool_type (String) Its value can be Autoscale or Static
  • specs_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 creation
  • custom_param_name (String) Custom parameter name for the worker node pool
  • custom_param_value (String) Custom parameter value for the worker node pool
  • policy_type (String) Policy type for the worker node pool
  • service_id (String) Services ID of the worker node pool
  • sku_id (String) SKU ID of the worker node pool
  • slug_name (String) Slug name of the worker node pool

Nested Schema for node_pools.elasticity_dict

Optional:

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 number
  • policy_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) Cooldown
  • operator (String) Operator for adding worker (e.g., >, >=)
  • period (Number) Period
  • value (Number) Value for adding worker
  • watch_period (Number) Period Number

Nested Schema for node_pools.scheduled_dict

Optional:

Nested Schema for node_pools.scheduled_dict.worker

Required:

Nested Schema for node_pools.scheduled_dict.worker.scheduled_policies

Required:

  • downscale_cardinality (Number) The cardinality for downscaling
  • downscale_recurrence (String) The recurrence timing for downscaling
  • upscale_cardinality (Number) The cardinality for upscaling
  • upscale_recurrence (String) The recurrence timing for upscaling