Skip to content

Commit

Permalink
feat: Add support for https_proxy parameter for the config_sync.git b…
Browse files Browse the repository at this point in the history
…lock (terraform-google-modules#1457)

* Add support for https_proxy parameter for the config_sync.git block

* Changes post make buid and make docker_generate_docs runs
  • Loading branch information
muresan authored and ericyz committed Nov 17, 2022
1 parent 5f468fd commit be0906c
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 12 deletions.
2 changes: 0 additions & 2 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,12 @@ resource "google_container_cluster" "primary" {
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
enable_private_nodes = private_cluster_config.value.enable_private_nodes
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
{% if beta_cluster %}
dynamic "master_global_access_config" {
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
content {
enabled = master_global_access_config.value
}
}
{% endif %}
}
}
{% endif %}
Expand Down
10 changes: 6 additions & 4 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,18 @@ variable "master_ipv4_cidr_block" {
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
default = "10.0.0.0/28"
}
{% if beta_cluster %}

variable "master_global_access_enabled" {
type = bool
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

{% if beta_cluster %}
default = true
{% else %}
default = false
{% endif %}
}
{% endif %}
{% endif %}

variable "dns_cache" {
type = bool
Expand Down
1 change: 1 addition & 0 deletions modules/acm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ data "google_client_config" "default" {}
| enable\_policy\_controller | Whether to enable the ACM Policy Controller on the cluster | `bool` | `true` | no |
| enable\_referential\_rules | Enables referential constraints which reference another object in it definition and are therefore eventually consistent. | `bool` | `true` | no |
| hierarchy\_controller | Configurations for Hierarchy Controller. See [Hierarchy Controller docs](https://cloud.google.com/anthos-config-management/docs/how-to/installing-hierarchy-controller) for more details | `map(any)` | `null` | no |
| https\_proxy | URL for the HTTPS proxy to be used when communicating with the Git repo. | `string` | `null` | no |
| install\_template\_library | Whether to install the default Policy Controller template library | `bool` | `true` | no |
| location | GCP location used to reach cluster. | `string` | n/a | yes |
| policy\_dir | Subfolder containing configs in ACM Git repo. If un-set, uses Config Management default. | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/acm/feature.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ resource "google_gke_hub_feature_membership" "main" {
sync_branch = var.sync_branch != "" ? var.sync_branch : null
sync_rev = var.sync_revision != "" ? var.sync_revision : null
secret_type = var.secret_type
https_proxy = var.https_proxy
}
}

Expand Down
6 changes: 6 additions & 0 deletions modules/acm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ variable "secret_type" {
default = "ssh"
}

variable "https_proxy" {
description = "URL for the HTTPS proxy to be used when communicating with the Git repo."
type = string
default = null
}

variable "create_ssh_key" {
description = "Controls whether a key will be generated for Git authentication"
type = bool
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ 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 |
| master\_global\_access\_enabled | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | 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\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | 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
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ variable "master_ipv4_cidr_block" {

variable "master_global_access_enabled" {
type = bool
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

default = true
}
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 @@ -224,7 +224,7 @@ 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 |
| master\_global\_access\_enabled | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | 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\_enable\_managed\_prometheus | (Beta) 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 |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ variable "master_ipv4_cidr_block" {

variable "master_global_access_enabled" {
type = bool
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

default = true
}
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 @@ -202,7 +202,7 @@ 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 |
| master\_global\_access\_enabled | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | 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\_enable\_managed\_prometheus | (Beta) 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 |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ variable "master_ipv4_cidr_block" {

variable "master_global_access_enabled" {
type = bool
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

default = true
}
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ 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 |
| 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` | `false` | 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\_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 |
| name | The name of the cluster (required) | `string` | n/a | yes |
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ resource "google_container_cluster" "primary" {
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
enable_private_nodes = private_cluster_config.value.enable_private_nodes
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
dynamic "master_global_access_config" {
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
content {
enabled = master_global_access_config.value
}
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions modules/private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ variable "master_ipv4_cidr_block" {
default = "10.0.0.0/28"
}

variable "master_global_access_enabled" {
type = bool
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

default = false
}

variable "dns_cache" {
type = bool
description = "The status of the NodeLocal DNSCache addon."
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ 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 |
| 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` | `false` | 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\_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 |
| name | The name of the cluster (required) | `string` | n/a | yes |
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ resource "google_container_cluster" "primary" {
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
enable_private_nodes = private_cluster_config.value.enable_private_nodes
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
dynamic "master_global_access_config" {
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
content {
enabled = master_global_access_config.value
}
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ variable "master_ipv4_cidr_block" {
default = "10.0.0.0/28"
}

variable "master_global_access_enabled" {
type = bool
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."

default = false
}

variable "dns_cache" {
type = bool
description = "The status of the NodeLocal DNSCache addon."
Expand Down

0 comments on commit be0906c

Please sign in to comment.