Skip to content

Commit

Permalink
feat: add advanced datapath observability config option
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKangaroo committed Oct 20, 2023
1 parent 2beb720 commit f59ebe2
Show file tree
Hide file tree
Showing 23 changed files with 182 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ Then perform the following commands on the root folder:
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
Expand Down
4 changes: 4 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
17 changes: 17 additions & 0 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,23 @@ variable "monitoring_enable_managed_prometheus" {
default = false
}

variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
type = bool
description = "Whether or not the advanced datapath metrics are enabled."
default = null
}

variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
type = string
description = "Mode used to make advanced datapath metrics relay available."
default = null
validation {
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
}

}

variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
Expand Down
4 changes: 4 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ Then perform the following commands on the root folder:
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
17 changes: 17 additions & 0 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,23 @@ variable "monitoring_enable_managed_prometheus" {
default = false
}

variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
type = bool
description = "Whether or not the advanced datapath metrics are enabled."
default = null
}

variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
type = string
description = "Mode used to make advanced datapath metrics relay available."
default = null
validation {
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
}

}

variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ Then perform the following commands on the root folder:
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
17 changes: 17 additions & 0 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,23 @@ variable "monitoring_enable_managed_prometheus" {
default = false
}

variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
type = bool
description = "Whether or not the advanced datapath metrics are enabled."
default = null
}

variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
type = string
description = "Mode used to make advanced datapath metrics relay available."
default = null
validation {
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
}

}

variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ Then perform the following commands on the root folder:
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
17 changes: 17 additions & 0 deletions modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,23 @@ variable "monitoring_enable_managed_prometheus" {
default = false
}

variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
type = bool
description = "Whether or not the advanced datapath metrics are enabled."
default = null
}

variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
type = string
description = "Mode used to make advanced datapath metrics relay available."
default = null
validation {
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
}

}

variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ Then perform the following commands on the root folder:
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
17 changes: 17 additions & 0 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,23 @@ variable "monitoring_enable_managed_prometheus" {
default = false
}

variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
type = bool
description = "Whether or not the advanced datapath metrics are enabled."
default = null
}

variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
type = string
description = "Mode used to make advanced datapath metrics relay available."
default = null
validation {
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
}

}

variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
Expand Down
2 changes: 2 additions & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ Then perform the following commands on the root folder:
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
| monitoring\_advanced\_datapath\_observability\_config\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
| monitoring\_enable\_advanced\_datapath\_observability\_config\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `null` | no |
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ resource "google_container_cluster" "primary" {
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
advanced_datapath_observability_config {
enabled = var.monitoring_enable_advanced_datapath_observability_config_metrics
relay_mode = var.monitoring_advanced_datapath_observability_config_metrics_relay_mode
}
}
}
cluster_autoscaling {
Expand Down
17 changes: 17 additions & 0 deletions modules/private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,23 @@ variable "monitoring_enable_managed_prometheus" {
default = false
}

variable "monitoring_enable_advanced_datapath_observability_config_metrics" {
type = bool
description = "Whether or not the advanced datapath metrics are enabled."
default = null
}

variable "monitoring_advanced_datapath_observability_config_metrics_relay_mode" {
type = string
description = "Mode used to make advanced datapath metrics relay available."
default = null
validation {
condition = contains(["DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB", null], var.node_metadata)
error_message = "The advanced datapath metrics relay value must be one of DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB."
}

}

variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration."
Expand Down
Loading

0 comments on commit f59ebe2

Please sign in to comment.