Skip to content

Commit fb4b732

Browse files
author
chrislovecnm
committed
Creation of new variable configure_ip_masq controlling ip masq install
Aliased IP addresses do not require ip masquerading anymore. There are few use cases where we would need ip masq, but usually it is not recommended to install ip masquerading. This variable allows for fine gain control on the installation of ip masq as it was always installed via the network_policy variable previously. configure_ip_masq defaults to false. Fixes: #172
1 parent 075e9c2 commit fb4b732

File tree

14 files changed

+34
-5
lines changed

14 files changed

+34
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
117117
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
118118
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
119119
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `""` | no |
120+
| 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. | string | `"false"` | no |
120121
| description | The description of the cluster | string | `""` | no |
121122
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | string | `"true"` | no |
122123
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |

autogen/masq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create ip-masq-agent confimap
2121
*****************************************/
2222
resource "kubernetes_config_map" "ip-masq-agent" {
23-
count = "${var.network_policy ? 1 : 0}"
23+
count = "${var.configure_ip_masq ? 1 : 0}"
2424

2525
metadata {
2626
name = "ip-masq-agent"

autogen/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ variable "ip_masq_link_local" {
237237
default = "false"
238238
}
239239

240+
variable "configure_ip_masq" {
241+
description = "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."
242+
default = "false"
243+
}
244+
240245
variable "logging_service" {
241246
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
242247
default = "logging.googleapis.com"

masq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create ip-masq-agent confimap
2121
*****************************************/
2222
resource "kubernetes_config_map" "ip-masq-agent" {
23-
count = "${var.network_policy ? 1 : 0}"
23+
count = "${var.configure_ip_masq ? 1 : 0}"
2424

2525
metadata {
2626
name = "ip-masq-agent"

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
125125
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
126126
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
127127
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `""` | no |
128+
| 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. | string | `"false"` | no |
128129
| database\_encryption | Application-layer Secrets Encryption settings. Example: database_encryption = [{ state = "ENCRYPTED", key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key" }] | list | `<list>` | no |
129130
| deploy\_using\_private\_endpoint | (Beta) A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | string | `"false"` | no |
130131
| description | The description of the cluster | string | `""` | no |

modules/beta-private-cluster/masq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create ip-masq-agent confimap
2121
*****************************************/
2222
resource "kubernetes_config_map" "ip-masq-agent" {
23-
count = "${var.network_policy ? 1 : 0}"
23+
count = "${var.configure_ip_masq ? 1 : 0}"
2424

2525
metadata {
2626
name = "ip-masq-agent"

modules/beta-private-cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ variable "ip_masq_link_local" {
235235
default = "false"
236236
}
237237

238+
variable "configure_ip_masq" {
239+
description = "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."
240+
default = "false"
241+
}
242+
238243
variable "logging_service" {
239244
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
240245
default = "logging.googleapis.com"

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
120120
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
121121
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
122122
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `""` | no |
123+
| 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. | string | `"false"` | no |
123124
| database\_encryption | Application-layer Secrets Encryption settings. Example: database_encryption = [{ state = "ENCRYPTED", key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key" }] | list | `<list>` | no |
124125
| description | The description of the cluster | string | `""` | no |
125126
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | string | `"true"` | no |

modules/beta-public-cluster/masq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create ip-masq-agent confimap
2121
*****************************************/
2222
resource "kubernetes_config_map" "ip-masq-agent" {
23-
count = "${var.network_policy ? 1 : 0}"
23+
count = "${var.configure_ip_masq ? 1 : 0}"
2424

2525
metadata {
2626
name = "ip-masq-agent"

modules/beta-public-cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ variable "ip_masq_link_local" {
222222
default = "false"
223223
}
224224

225+
variable "configure_ip_masq" {
226+
description = "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."
227+
default = "false"
228+
}
229+
225230
variable "logging_service" {
226231
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
227232
default = "logging.googleapis.com"

0 commit comments

Comments
 (0)