Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

internal load balancer loses backend when pods scaled down to 0

Hi all,

I have an internal load balancer setup for access to our pods in GKE autopilot, with this yaml:

apiVersion: v1
kind: Service
metadata:
  name: internal-load-balancer-svc
  namespace: default
  annotations:
    networking.gke.io/load-balancer-type: "Internal"
spec:
  type: LoadBalancer
  loadBalancerIP: 10.128.0.62
  externalTrafficPolicy: Cluster
  selector:
    app: pgbouncer-main
  ports:
  - name: tcp-port
    protocol: TCP
    port: 5432
    targetPort: 5432
 
This setup works fine to send traffic to our pods. The problem arises when I'm done for the day, I scale our pods down to 0 and then when I return and scale up the pod to 1 to resume testing, there is no backends configured for the load balancer:
 
somersru_0-1692981339576.png

So I have to delete the load balancer and reload it from our cloud build/terraform setup. This works fine after I do it.  This is what it looks like:

somersru_1-1692981483939.png

But I have been scaling down the pod for months, but in the last week or so when I scale back up the pod there is no backend 

1 0 130