Open michael-bouvy opened 4 years ago
resource "alicloud_cs_managed_kubernetes" "k8s" {
# Reference worker VSwitch IDs from previously defined vswitches
worker_vswitch_ids = alicloud_vswitch.vswitches.*.id
# Define the instance types for worker nodes
worker_instance_types = var.alicloud_kubernetes_worker_instance_types
# Set the number of worker nodes
worker_number = var.alicloud_kubernetes_worker_number
# Specify the CIDR mask for the Kubernetes nodes
node_cidr_mask = 24
# Define the login password for the worker nodes (consider storing passwords securely)
password = var.alicloud_kubernetes_password
# Pod CIDR block for the Kubernetes cluster
pod_cidr = var.alicloud_kubernetes_pod_cidr_block
# Service CIDR block for Kubernetes services
service_cidr = var.alicloud_kubernetes_service_cidr_block
# Specify the Kubernetes version (consider updating to a more recent version if required)
version = "1.16.6-aliyun.1"
# Specify worker node disk category (cloud SSD)
worker_disk_category = "cloud_ssd"
# Instance charge type for worker nodes (e.g., PrePaid, PostPaid)
worker_instance_charge_type = var.alicloud_kubernetes_worker_instance_charge_type
# Specify the billing period for worker nodes (in months)
worker_period = var.alicloud_kubernetes_worker_period
# Enable auto-renewal for worker nodes
worker_auto_renew = var.alicloud_kubernetes_worker_auto_renew
# Optional: Specify tags for your cluster if needed
tags = {
Name = "my-k8s-cluster"
Environment = "production"
}
}
When creating a CS Managed Kubernetes Cluster (with
slb_internet_enabled
totrue
, which is default value), a SLB of typeslb.s1.small
is created.There is no option in the
alicloud_cs_managed_kubernetes_clusters
resource to specify another SLB instance type. Furthermore, when changing the SLB instance type from the console, terraform wont see any remote change.Terraform Version
Affected Resource(s)
alicloud_cs_managed_kubernetes_clusters
Terraform Configuration Files