Skip to content
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

feat: Allow enabling cost management for safer_cluster module #1475

Merged
Merged
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
3 changes: 3 additions & 0 deletions autogen/safer-cluster/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ module "gke" {
// We suggest to define policies about which images can run on a cluster.
enable_binary_authorization = true

// Enable cost allocation support
enable_cost_allocation = var.enable_cost_allocation

// Use of PodSecurityPolicy admission controller
// https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies
enable_pod_security_policy = var.enable_pod_security_policy
Expand Down
6 changes: 6 additions & 0 deletions autogen/safer-cluster/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ variable "enable_resource_consumption_export" {
default = true
}

variable "enable_cost_allocation" {
type = bool
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "sandbox_enabled" {
type = bool
description = "(Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it)."
Expand Down
1 change: 1 addition & 0 deletions modules/safer-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ For simplicity, we suggest using `roles/container.admin` and
| description | The description of the cluster | `string` | `""` | no |
| disable\_default\_snat | Whether to disable the default SNAT to support the private use of public IP addresses | `bool` | `false` | no |
| dns\_cache | (Beta) The status of the NodeLocal DNSCache addon. | `bool` | `false` | no |
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | `bool` | `false` | no |
Expand Down
3 changes: 3 additions & 0 deletions modules/safer-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ module "gke" {
// We suggest to define policies about which images can run on a cluster.
enable_binary_authorization = true

// Enable cost allocation support
enable_cost_allocation = var.enable_cost_allocation

// Use of PodSecurityPolicy admission controller
// https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies
enable_pod_security_policy = var.enable_pod_security_policy
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 @@ -356,6 +356,12 @@ variable "enable_resource_consumption_export" {
default = true
}

variable "enable_cost_allocation" {
type = bool
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "sandbox_enabled" {
type = bool
description = "(Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it)."
Expand Down
1 change: 1 addition & 0 deletions modules/safer-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ For simplicity, we suggest using `roles/container.admin` and
| description | The description of the cluster | `string` | `""` | no |
| disable\_default\_snat | Whether to disable the default SNAT to support the private use of public IP addresses | `bool` | `false` | no |
| dns\_cache | (Beta) The status of the NodeLocal DNSCache addon. | `bool` | `false` | no |
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | `bool` | `false` | no |
Expand Down
3 changes: 3 additions & 0 deletions modules/safer-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ module "gke" {
// We suggest to define policies about which images can run on a cluster.
enable_binary_authorization = true

// Enable cost allocation support
enable_cost_allocation = var.enable_cost_allocation

// Use of PodSecurityPolicy admission controller
// https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies
enable_pod_security_policy = var.enable_pod_security_policy
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 @@ -356,6 +356,12 @@ variable "enable_resource_consumption_export" {
default = true
}

variable "enable_cost_allocation" {
type = bool
description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery"
default = false
}

variable "sandbox_enabled" {
type = bool
description = "(Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it)."
Expand Down