To make a LoadBalancer service internal on GKE

Viewed 245

Do you know what is the annotation that we can use it on GKE to make a LoadBalancer service internal?. For example Azure (and AWS) supports the following annotation (shown in the YAML code snippet) to make a LoadBalancer service internal. I couldn’t find equivalent of it on GKE. For example naturally one may expect gcp-load-balancer-internal as the equivalent annotation on GKE; unfortunately it is not. Here is the Azure and AWS documentation for it, I am looking equivalent of it on GKE.

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: "true"
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
2 Answers

The equivalent can be found here.

apiVersion: v1
kind: Service
metadata:
  name: ilb-service
  annotations:
    networking.gke.io/load-balancer-type: "Internal"
  labels:
    app: hello
spec:
  type: LoadBalancer
  selector:
    app: hello
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP
Related