kubernetes / ingress-nginx

Ingress NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.39k stars 8.24k forks source link

Nginx ingress, GKE and static IP #1281

Closed guizmaii closed 7 years ago

guizmaii commented 7 years ago

Hi,

Do you agree if I say that, currently, it's impossible to config a Nginx Ingress (kubernetes.io/ingress.class: "nginx") in GKE that uses a previously reserved (gcloud compute addresses create <static_ip_id> --global) static IP ?

Because I'm not able to make it works.

Until now, I understood that there're two possible Ingress configurations:

Do we agree on that ?

Because of the current limitations of the Google Cloud HTTP(S) load balancer, I chose to use the Nginx Ingress but I'm not able to bind the static to my cluster.

Do you have an idea to help me ?

My problem seems to be the same as explained here: https://github.com/kubernetes/ingress/issues/280

the EXTERNAL-IP of nginx-ingress-lb is keeping pending.

I'm using this version: nginx-ingress-controller:0.8.3 because the 0.9.0-betaX version don't work with kube-lego (https://github.com/jetstack/kube-lego)

I remarked that the --publish-service Nginx Ingress command doesn't exist in the 0.8.3 version. Could this be the problem ? Answer to my own question: It's not. I deployed the https://github.com/kubernetes/ingress/tree/master/examples/static-ip/nginx with a pre-reserved static IP and it doesn't work. The Ingress never get associated to the static IP

Thanks, Jules :)

guizmaii commented 7 years ago

Ok after some tests with the "static ip" example, I could affirm that we can bind a Google Cloud pre-reserved static IP to a Nginx Ingress if the static IP is a regional one.

But It seems not to work with global IPs.

Is this a normal behavior ? is this documented somewhere ?

aledbf commented 7 years ago

But It seems not to work with global IPs.

ping @nicksardo

nicksardo commented 7 years ago

It's documented on the GCE side at https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules.

guizmaii commented 7 years ago

OK thanks. Maybe it could be useful to explain that in your doc too, no ?

aledbf commented 7 years ago

@guizmaii can we close this issue?

itaimalek commented 6 years ago

Hi, can someone add the correct annotation to bind the regional static IP? I can't seem to find it anywhere.

Thanks :)

jdalegonzalez commented 6 years ago

@itaimalek As far as I know, there isn't an annotation to bind to the regional IP. Instead, you reserve a regional IP and then use it as the IP address inside your yaml file.

spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  loadBalancerIP: @GKE_STATIC_IP_ADDRESS  # static IP pre-allocated.
itaimalek commented 6 years ago

Yes, I git it eventually :) Thanks !

On Oct 23, 2017 23:05, "jdalegonzalez" notifications@github.com wrote:

As far as I know, there isn't an annotation to bind to the regional IP. Instead, you reserve a regional IP and then use it as the IP address inside your yaml file.

spec: type: LoadBalancer externalTrafficPolicy: Local loadBalancerIP: @GKE_STATIC_IP_ADDRESS # static IP pre-allocated.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kubernetes/ingress-nginx/issues/1281#issuecomment-338780249, or mute the thread https://github.com/notifications/unsubscribe-auth/AIILSD8bgQuvs9kMS-AZxee9-znLZhr8ks5svPGWgaJpZM4PJCTj .

evelant commented 6 years ago

The configuration suggested by @jdalegonzalez does not work for me. My ingress controller load balancer gets the correct fixed IP but every request returns a 503. @itaimalek What ended up being a working configuration for you?

Edit: nevermind, it does work using the above config. I had an error in my application that I had missed.

jdalegonzalez commented 6 years ago

Did you look at the ingress logs? 503 is bad gateway, right? I had this problem when the ingress couldn't load the GeoLite.dat file due to lack of memory. For me, removing the memory constraint in the yaml file solved it.

On Fri, Apr 6, 2018, 7:32 PM amorsillo notifications@github.com wrote:

The configuration suggested by @jdalegonzalez https://github.com/jdalegonzalez does not work for me. My ingress controller load balancer gets the correct fixed IP but every request returns a 503. @itaimalek https://github.com/itaimalek What ended up being a working configuration for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/ingress-nginx/issues/1281#issuecomment-379410761, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZ6hNldZ5pp19H0raM8IOtOKB3EanG_ks5tl_sCgaJpZM4PJCTj .