Skip to content

Commit

Permalink
Merge branch 'master' into fix/promethus-enable
Browse files Browse the repository at this point in the history
  • Loading branch information
ericyz committed Aug 25, 2023
2 parents 6aec917 + ae63848 commit b734db5
Show file tree
Hide file tree
Showing 36 changed files with 124 additions and 182 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Then perform the following commands on the root folder:
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
Expand Down
47 changes: 12 additions & 35 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,45 +109,22 @@ resource "google_container_cluster" "primary" {
}
{% if beta_cluster %}
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service
dynamic "monitoring_config" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content{
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
content {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
}
}
}
{% else %}
monitoring_service = local.logmon_config_is_set ? null : var.monitoring_service
{% endif %}
dynamic "monitoring_config" {
{% if beta_cluster %}
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
{% else %}
for_each = local.logmon_config_is_set || local.logmon_config_is_set ? [1] : []
{% endif %}
content{
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
content {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
enable_components = var.monitoring_enabled_components
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
{% endif %}
cluster_autoscaling {
enabled = var.cluster_autoscaling.enabled
dynamic "auto_provisioning_defaults" {
Expand Down Expand Up @@ -307,6 +284,10 @@ resource "google_container_cluster" "primary" {
enabled = gke_backup_agent_config.value.enabled
}
}

config_connector_config {
enabled = var.config_connector
}
{% endif %}
{% if beta_cluster and autopilot_cluster != true %}

Expand All @@ -326,10 +307,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = var.kalm_config
}

config_connector_config {
enabled = var.config_connector
}
{% endif %}
}
{% if autopilot_cluster != true %}
Expand Down
12 changes: 6 additions & 6 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ variable "enable_kubernetes_alpha" {
description = "Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days."
default = false
}

variable "config_connector" {
type = bool
description = "Whether ConfigConnector is enabled for this cluster."
default = false
}
{% endif %}
{% if beta_cluster %}
{% if autopilot_cluster != true %}
Expand All @@ -733,12 +739,6 @@ variable "kalm_config" {
default = false
}

variable "config_connector" {
type = bool
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
type = bool
Expand Down
2 changes: 1 addition & 1 deletion autogen/safer-cluster/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ variable "firewall_inbound_ports" {

variable "config_connector" {
type = bool
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
description = "Whether ConfigConnector is enabled for this cluster."
default = false
}

Expand Down
19 changes: 7 additions & 12 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,9 @@ resource "google_container_cluster" "primary" {
dynamic "monitoring_config" {
for_each = local.logmon_config_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
content {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
enable_components = var.monitoring_enabled_components
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
Expand Down Expand Up @@ -204,6 +195,10 @@ resource "google_container_cluster" "primary" {
enabled = gke_backup_agent_config.value.enabled
}
}

config_connector_config {
enabled = var.config_connector
}
}

datapath_provider = var.datapath_provider
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Then perform the following commands on the root folder:
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
Expand Down
23 changes: 7 additions & 16 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,9 @@ resource "google_container_cluster" "primary" {
dynamic "monitoring_config" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
content {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
enable_components = var.monitoring_enabled_components
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
Expand Down Expand Up @@ -237,6 +228,10 @@ resource "google_container_cluster" "primary" {
}
}

config_connector_config {
enabled = var.config_connector
}

istio_config {
disabled = !var.istio
auth = var.istio_auth
Expand All @@ -253,10 +248,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = var.kalm_config
}

config_connector_config {
enabled = var.config_connector
}
}

datapath_provider = var.datapath_provider
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,12 @@ variable "enable_kubernetes_alpha" {
default = false
}

variable "config_connector" {
type = bool
description = "Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "istio" {
description = "(Beta) Enable Istio addon"
type = bool
Expand All @@ -692,12 +698,6 @@ variable "kalm_config" {
default = false
}

variable "config_connector" {
type = bool
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
type = bool
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Then perform the following commands on the root folder:
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
Expand Down
23 changes: 7 additions & 16 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,9 @@ resource "google_container_cluster" "primary" {
dynamic "monitoring_config" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
content {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
enable_components = var.monitoring_enabled_components
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
Expand Down Expand Up @@ -237,6 +228,10 @@ resource "google_container_cluster" "primary" {
}
}

config_connector_config {
enabled = var.config_connector
}

istio_config {
disabled = !var.istio
auth = var.istio_auth
Expand All @@ -253,10 +248,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = var.kalm_config
}

config_connector_config {
enabled = var.config_connector
}
}

datapath_provider = var.datapath_provider
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,12 @@ variable "enable_kubernetes_alpha" {
default = false
}

variable "config_connector" {
type = bool
description = "Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "istio" {
description = "(Beta) Enable Istio addon"
type = bool
Expand All @@ -692,12 +698,6 @@ variable "kalm_config" {
default = false
}

variable "config_connector" {
type = bool
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
type = bool
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Then perform the following commands on the root folder:
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
Expand Down
23 changes: 7 additions & 16 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,9 @@ resource "google_container_cluster" "primary" {
dynamic "monitoring_config" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
content {
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
dynamic "managed_prometheus" {
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
content {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
enable_components = var.monitoring_enabled_components
managed_prometheus {
enabled = var.monitoring_enable_managed_prometheus
}
}
}
Expand Down Expand Up @@ -237,6 +228,10 @@ resource "google_container_cluster" "primary" {
}
}

config_connector_config {
enabled = var.config_connector
}

istio_config {
disabled = !var.istio
auth = var.istio_auth
Expand All @@ -253,10 +248,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = var.kalm_config
}

config_connector_config {
enabled = var.config_connector
}
}

datapath_provider = var.datapath_provider
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,12 @@ variable "enable_kubernetes_alpha" {
default = false
}

variable "config_connector" {
type = bool
description = "Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "istio" {
description = "(Beta) Enable Istio addon"
type = bool
Expand All @@ -662,12 +668,6 @@ variable "kalm_config" {
default = false
}

variable "config_connector" {
type = bool
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
type = bool
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Then perform the following commands on the root folder:
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
Expand Down
Loading

0 comments on commit b734db5

Please sign in to comment.