Skip to content

Commit

Permalink
Creation of new variable configure_ip_masq controlling ip masq install
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chrislovecnm committed Jun 25, 2019
1 parent 348549a commit e6c33fa
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
|------|-------------|:----:|:-----:|:-----:|
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
| 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 |
| 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 |
| description | The description of the cluster | string | `""` | no |
| 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 |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |
Expand Down
2 changes: 1 addition & 1 deletion autogen/masq.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create ip-masq-agent confimap
*****************************************/
resource "kubernetes_config_map" "ip-masq-agent" {
count = "${var.network_policy ? 1 : 0}"
count = "${var.configure_ip_masq ? 1 : 0}"

metadata {
name = "ip-masq-agent"
Expand Down
5 changes: 5 additions & 0 deletions autogen/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ variable "ip_masq_link_local" {
default = "false"
}

variable "configure_ip_masq" {
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."
default = "false"
}

variable "logging_service" {
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
default = "logging.googleapis.com"
Expand Down
2 changes: 1 addition & 1 deletion masq.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create ip-masq-agent confimap
*****************************************/
resource "kubernetes_config_map" "ip-masq-agent" {
count = "${var.network_policy ? 1 : 0}"
count = "${var.configure_ip_masq ? 1 : 0}"

metadata {
name = "ip-masq-agent"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
| 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 |
| cloudrun | (Beta) Enable CloudRun addon | string | `"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. | string | `"false"` | no |
| 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 |
| 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 |
| description | The description of the cluster | string | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/masq.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create ip-masq-agent confimap
*****************************************/
resource "kubernetes_config_map" "ip-masq-agent" {
count = "${var.network_policy ? 1 : 0}"
count = "${var.configure_ip_masq ? 1 : 0}"

metadata {
name = "ip-masq-agent"
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ variable "ip_masq_link_local" {
default = "false"
}

variable "configure_ip_masq" {
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."
default = "false"
}

variable "logging_service" {
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
default = "logging.googleapis.com"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
| 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 |
| cloudrun | (Beta) Enable CloudRun addon | string | `"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. | string | `"false"` | no |
| 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 |
| description | The description of the cluster | string | `""` | no |
| 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 |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/masq.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create ip-masq-agent confimap
*****************************************/
resource "kubernetes_config_map" "ip-masq-agent" {
count = "${var.network_policy ? 1 : 0}"
count = "${var.configure_ip_masq ? 1 : 0}"

metadata {
name = "ip-masq-agent"
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ variable "ip_masq_link_local" {
default = "false"
}

variable "configure_ip_masq" {
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."
default = "false"
}

variable "logging_service" {
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
default = "logging.googleapis.com"
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 @@ -121,6 +121,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
|------|-------------|:----:|:-----:|:-----:|
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
| 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 |
| 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 |
| 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 |
| description | The description of the cluster | string | `""` | no |
| 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 |
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster/masq.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create ip-masq-agent confimap
*****************************************/
resource "kubernetes_config_map" "ip-masq-agent" {
count = "${var.network_policy ? 1 : 0}"
count = "${var.configure_ip_masq ? 1 : 0}"

metadata {
name = "ip-masq-agent"
Expand Down
5 changes: 5 additions & 0 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ variable "ip_masq_link_local" {
default = "false"
}

variable "configure_ip_masq" {
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."
default = "false"
}

variable "logging_service" {
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
default = "logging.googleapis.com"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ variable "ip_masq_link_local" {
default = "false"
}

variable "configure_ip_masq" {
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."
default = "false"
}

variable "logging_service" {
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
default = "logging.googleapis.com"
Expand Down

0 comments on commit e6c33fa

Please sign in to comment.