0

I have VMs on GCP, which are normal Linux machines not GKE. I made kubernetes environment with kubeadm on this VMs and I am using NodePort type for my services.

But what I want to do is using type LoadBalancer for my services. Can I use LoadBalancer type with GCP Clound Load Balancing? I searched on Google many times but most of the result are for GKE which I am not using.

Ellisein
  • 101
  • Hi Ellisein welcome to S.F. Have you already tried [the out-of-tree GCP provider](https://github.com/kubernetes/cloud-provider-gcp#readme)? they've been pushing to get the cloud providers out into their own deployments, but I don't know what the status is of that one – mdaniel Aug 16 '22 at 02:28

1 Answers1

0

Note that in GKE, Load Balancer alone will create a Network Load Balancer (layer 4) while Ingress will use HTTP(S) load balancer (layer7). I will assume they want to use layer 7 load balancing

Using Nodeport (possibly with manual port allocation) + configuring HTTP load balancer to use this port as backend is the obvious solution and IIUC what they might be currently doing.

Having Kubernetes automatically create a GCP HTTP(s) load balancer will require an ingress controller.

Our ingress-gce controller is actually open source.

There is some brief documentation mentioning how to run it on GCE.

  • As an observation, OP asked only about `LoadBalancer`, and didn't mention Ingress -- they're related, but distinct. If one goes with the "obvious solution," it places the burden upon the user to keep the Node list synced to the provisioned load balancer – mdaniel Aug 18 '22 at 15:07