6

When I create a GKE ingress controller, by default it created a public ip. Is it possible to create an GKE ingress controller with internal IP?

I have exposed my service as type Ingress, I do not have an option to specify if my ip has to be internal or external.

However, if I expose my service as LoadBalancer, I can specify the type of IP. annotations: cloud.google.com/load-balancer -type: "Internal"

3 Answers 3

2

It sounds like an internal loadbalancer is what you are looking for. An internal load balancer will create a private load balancer ingress IP. This will make your services accessible to the network outside of the cluster, more specifically, "on the network within the same compute region from an IP range in the user’s subnet.", not exposed to the public internet.

Pricing information as well as examples YAML & kubectl commands are within the document.

2
  • 1
    I have exposed my service as type Ingress, I do not have an option to specify if my ip has to be internal or external. However, if I expose my service as LoadBalancer, I can specify the type of IP. annotations: cloud.google.com/load-balancer-type: "Internal" Nov 22, 2018 at 4:01
  • Ingress' are used for exposing internal services externally via HTTP &/or HTTPS. You will not be able to create an internal ingress. Best to explore the option of internal load balancers mentioned previously.
    – xavierc
    Nov 22, 2018 at 20:48
0

Now, Google supports Ingress for Internal HTTP(S) Load Balancing.

0

You can create internal ingress controller by adding an annotation while installing ingree controller using helm chart. Reference: https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balance-ingress#deploy-ingress

annotations:
    kubernetes.gke.io/load-balancer-type: "Internal"

helm install --name ingress-controller stable/nginx-ingress \
--set controller.service.annotations."networking\.gke\.io/load-balancer-type"="Internal"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.