Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does GKE support nginx-ingress with static ip?

I have been using the Google Cloud Load Balancer ingress. However, I'm trying to install a nginxinc/kubernetes-ingress controller in a node with a Static IP address in GKE.

  1. Can I use Google's Cloud Load Balancer ingress controller in the same cluster?
  2. How can we use the nginxinc/kubernetes-ingress with a static IP?

Thanks

like image 238
John Avatar asked Feb 13 '18 09:02

John


2 Answers

For the nginx-ingress controller you have to set the external IP on the service:

spec:
  loadBalancerIP: "42.42.42.42"
  externalTrafficPolicy: "Local"
like image 165
unguiculus Avatar answered Sep 30 '22 19:09

unguiculus


In case you're using helm to deploy nginx-ingress.

First create a static IP address. In google the Network Loadbalancers (NLBs) only support regional static IPs:

gcloud compute addresses create my-static-ip-address --region us-east4

Then install nginx-helm with the ip address as a loadBalancerIP parameter

helm install --name nginx-ingress stable/nginx-ingress --namespace my-namespace --set controller.service.loadBalancerIP=35.186.172.1
like image 32
Bernie Lenz Avatar answered Sep 30 '22 20:09

Bernie Lenz