https://pulumi.com logo
Title
s

sparse-butcher-73713

12/22/2021, 7:37 AM
good morning everyone! does anyone know if the load balanced frontends we create in GKE as a service are charged separately by GCP? I can't find pricing info on that
p

prehistoric-activity-61023

12/22/2021, 9:54 AM
if you’re talking about services with
LoadBalancer
type, there are charged separately AFAIK
every
LoadBalancer
service will reserve a public IP address and create a forwarding rule; for the pricing check https://cloud.google.com/vpc/network-pricing and part “Load balancing and forwarding rules”
if you want to make it cheaper, I strongly suggest installing some ingress controller (like https://kubernetes.github.io/ingress-nginx/) so you can create one service exposing it (= pay for 1 forwarding rule) and route the incoming traffic internally via ingress definitions
s

sparse-butcher-73713

12/22/2021, 10:15 AM
interesting, thank you @prehistoric-activity-61023
@prehistoric-activity-61023, how do you then keep a service's infrastructure separate since you're affecting a shared resource (the ingress) ?
p

prehistoric-activity-61023

12/22/2021, 10:17 AM
you can declare multiple ingress resources
ingress-nginx controller (and other similar solutions) will take care of it
I hope that answers your question?
s

sparse-butcher-73713

12/22/2021, 10:18 AM
I'll take your word for it until I do some more reading 🙂
p

prehistoric-activity-61023

12/22/2021, 10:19 AM
in other words, in case of using some ingress controller, it usually looks like this: • 1 x load balancer service for handling incoming connections • N ingress resources defining different routes (based on path prefix, domain etc.)
s

sparse-butcher-73713

12/22/2021, 10:21 AM
right, so there's an internal load balancer that shares the load between replicas for a k8s service and then ingress rules define which lb the traffic ends up on?
p

prehistoric-activity-61023

12/22/2021, 10:21 AM
Give it a try on a fresh GKE instance, so you can check it yourself: • install https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke • usage https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/ Keep in mind that you might be forced to explicitly set
ingressClassName
to
nginx
. Otherwise, default ingress controller will handle it (and that might be Google Load Balancer).
Yep, I think you got it quite right.
Are you familiar with nginx?
Ingress-nginx controller actually observes the k8s resources (ingresses) and based on their specs, it updates the nginx configuration so it can properly route the requests. It’s “that” simple 😉
s

sparse-butcher-73713

12/22/2021, 10:28 AM
very good! reading up on GKE vs nginx ingress
@prehistoric-activity-61023 any idea where I can find an example to create the ingress itself (not the rule) on gke?
OMG it's further up
sorry 😕