Skip to content

feat: support cilium clusterwide #1973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ resource "google_container_cluster" "primary" {
}
}

enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy

enable_kubernetes_alpha = var.enable_kubernetes_alpha
enable_tpu = var.enable_tpu

Expand Down
3 changes: 2 additions & 1 deletion modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ resource "google_container_cluster" "primary" {
}
}

datapath_provider = var.datapath_provider
datapath_provider = var.datapath_provider
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy

networking_mode = "VPC_NATIVE"

Expand Down
6 changes: 6 additions & 0 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -848,3 +848,9 @@ variable "fleet_project_grant_service_agent" {
type = bool
default = false
}

variable "enable_cilium_clusterwide_network_policy" {
description = "(Optional) Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false."
type = bool
default = false
}
4 changes: 3 additions & 1 deletion modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ resource "google_container_cluster" "primary" {
}
}

datapath_provider = var.datapath_provider
datapath_provider = var.datapath_provider
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy


networking_mode = "VPC_NATIVE"

Expand Down
6 changes: 6 additions & 0 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -848,3 +848,9 @@ variable "fleet_project_grant_service_agent" {
type = bool
default = false
}

variable "enable_cilium_clusterwide_network_policy" {
description = "(Optional) Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false."
type = bool
default = false
}
3 changes: 2 additions & 1 deletion modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ resource "google_container_cluster" "primary" {
}
}

datapath_provider = var.datapath_provider
datapath_provider = var.datapath_provider
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy


security_posture_config {
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -758,3 +758,9 @@ variable "fleet_project" {
type = string
default = null
}

variable "enable_cilium_clusterwide_network_policy" {
description = "(Optional) Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false."
type = bool
default = false
}
3 changes: 2 additions & 1 deletion modules/safer-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ module "gke" {
// NOTE: Dataplane-V2 conflicts with the Calico network policy add-on because
// it provides redundant NetworkPolicy capabilities. If V2 is enabled, the
// Calico add-on should be disabled.
network_policy = var.datapath_provider == "ADVANCED_DATAPATH" ? false : true
network_policy = var.datapath_provider == "ADVANCED_DATAPATH" ? false : true
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy

// Default to the recommended Dataplane V2 which enables NetworkPolicies and
// allows for network policy logging of allowed and denied requests to Pods.
Expand Down
6 changes: 6 additions & 0 deletions modules/safer-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,9 @@ variable "deletion_protection" {
description = "Whether or not to allow Terraform to destroy the cluster."
default = true
}

variable "enable_cilium_clusterwide_network_policy" {
description = "(Optional) Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false."
type = bool
default = false
}
3 changes: 2 additions & 1 deletion modules/safer-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ module "gke" {

// Default to the recommended Dataplane V2 which enables NetworkPolicies and
// allows for network policy logging of allowed and denied requests to Pods.
datapath_provider = var.datapath_provider
datapath_provider = var.datapath_provider
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy

maintenance_start_time = var.maintenance_start_time
maintenance_end_time = var.maintenance_end_time
Expand Down
6 changes: 6 additions & 0 deletions modules/safer-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,9 @@ variable "deletion_protection" {
description = "Whether or not to allow Terraform to destroy the cluster."
default = true
}

variable "enable_cilium_clusterwide_network_policy" {
description = "(Optional) Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false."
type = bool
default = false
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -728,3 +728,9 @@ variable "fleet_project" {
type = string
default = null
}

variable "enable_cilium_clusterwide_network_policy" {
description = "(Optional) Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false."
type = bool
default = false
}