Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ip_masq with aliased ip addresses #172

Closed
chrislovecnm opened this issue Jun 14, 2019 · 7 comments · Fixed by #187
Closed

ip_masq with aliased ip addresses #172

chrislovecnm opened this issue Jun 14, 2019 · 7 comments · Fixed by #187
Labels
enhancement New feature or request

Comments

@chrislovecnm
Copy link
Contributor

When we have aliased ip addresses do we need ip_masq enabled for network policies?

https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/modules/private-cluster/masq.tf#L22

I am seeing this and I am wondering if we do not need this when we have aliased ip subnets for the services and pods.

@chrislovecnm
Copy link
Contributor Author

/cc @morgante

@aaron-lane aaron-lane added the question Further information is requested label Jun 14, 2019
@chrislovecnm
Copy link
Contributor Author

@aaron-lane after researching this, this is a bug. We do not and should not enable ip masq when using aliased ip addresses.

@morgante
Copy link
Contributor

@chrislovecnm The specific reasons for having this are two-fold:

  1. Alias IPs are often not routable from on-prem, so pods calling on-prem services need to have their calls NATed
  2. As far as I know, ip_masq is required to allow network policies to work. Do you have information to the contrary?

I would be open to adding an additional flag which disables ip-masq.

@chrislovecnm
Copy link
Contributor Author

As far as I know, ip_masq is required to allow network policies to work. Do you have information to the contrary?

I verified with a couple different engineers that we do not need it. Do you have documentation to the contrary? Yes, having an additional flag for it would be great. I agree with you on the first use case that we need to provide that support.

The reason this is a big inconvenience and a bit of a chicken and egg problem is that you cannot create the vpc, subnet, and private cluster from the same TF. You have to be on a bastion, or open up the api server endpoint (which I would not recommend). To be on a bastion, you have to have the subnet. Hence the chicken and egg problem. The base issues is that the kubectl call cannot communicate with the private server in order to install ip masq.

Thanks

@morgante
Copy link
Contributor

I verified with a couple different engineers that we do not need it. Do you have documentation to the contrary?

It looks like that requirement might be out of date.

I definitely see your use case. I suggest we add a configure_ip_masq variable which defaults to false (this will be a breaking change) and include it for that block.

Can you file a PR for this? If not we'll have someone handle it on our end.

@aaron-lane aaron-lane added enhancement New feature or request and removed question Further information is requested labels Jun 21, 2019
@chrislovecnm
Copy link
Contributor Author

chrislovecnm commented Jun 21, 2019

@morgante to clarify. Change this

resource "kubernetes_config_map" "ip-masq-agent" {
count = "${var.network_policy ? 1 : 0}"

To use a new variable:

count = "${var.configure_ip_masq ? 1 : 0}"

@morgante
Copy link
Contributor

Yes.

chrislovecnm pushed a commit to chrislovecnm/terraform-google-kubernetes-engine that referenced this issue Jun 21, 2019
Aliased IP addresses do not require ip masqerading anymore.  There are a
few usecases where we would need ip masq, but usually it is not recommended
to install ip masqerading. This variable allows for fine gain control on
the installation of ip masq as it was always installed via the network_policy
variable previsouly.

configure_ip_masq defaults to false.

Fixes: terraform-google-modules#172
chrislovecnm pushed a commit to chrislovecnm/terraform-google-kubernetes-engine that referenced this issue Jun 21, 2019
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: terraform-google-modules#172
chrislovecnm pushed a commit to chrislovecnm/terraform-google-kubernetes-engine that referenced this issue Jun 25, 2019
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: terraform-google-modules#172
chrislovecnm pushed a commit to chrislovecnm/terraform-google-kubernetes-engine that referenced this issue Jun 25, 2019
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: terraform-google-modules#172
chrislovecnm pushed a commit to chrislovecnm/terraform-google-kubernetes-engine that referenced this issue Jun 26, 2019
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: terraform-google-modules#172
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this issue Jul 15, 2024
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: terraform-google-modules#172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants