Description
In an independent TKE cluster, public_ip_assigned in master_config and worker_config controls node public IPs. cluster_internet controls the public Kubernetes API endpoint.
Potential impact
A public node IP can expose listening services when routing and security groups permit. Check the API management path separately.
Remediation
Set public_ip_assigned = false on nodes that do not need public IPs. Changing that flag in an existing master_config or worker_config replaces the cluster. Create the destination as a separate Terraform resource, move the workloads, and verify their operation and authenticated private API access before retiring the original. If changing only the public API setting, verify private access first.
Examples
The second excerpt disables public node IPs and the public API. It does not configure the private endpoint. Supply cluster_internet_security_group for a public API or cluster_intranet and cluster_intranet_subnet_id for a private one. Provide instance types, VPC settings and credentials separately.
Before
resource "tencentcloud_kubernetes_cluster" "example" {
cluster_name = "tf_example_cluster"
cluster_internet = true
cluster_deploy_type = "INDEPENDENT_CLUSTER"
master_config {
public_ip_assigned = true
}
worker_config {
public_ip_assigned = true
}
}
After
resource "tencentcloud_kubernetes_cluster" "example" {
cluster_name = "tf_example_cluster"
cluster_internet = false
cluster_deploy_type = "INDEPENDENT_CLUSTER"
master_config {
public_ip_assigned = false
}
worker_config {
public_ip_assigned = false
}
}