Terraform

Terraform

By DeepSource

Kubernetes Cluster is created with Private cluster disabled TF-S2025

Security

Private clusters enable isolation of nodes from any inbound and outbound connectivity to the public internet. This is achieved as the nodes have internal RFC 1918 IP addresses only. In private clusters, the cluster master has private and public endpoints. You can configure which endpoint should have access to control access to the public internet. By creating a private cluster, the nodes will have a reserved set of IP addresses, ensuring their workloads are isolated from the public internet.

We recommend you enable private cluster when creating Kubernetes clusters.

Examples

Recommended

resource "google_container_cluster" "cluster" {
...
  private_cluster_config {
    enable_private_nodes=true
  }
...
}