Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is there a way to apply IP masquerade only for a stateful set on GKE

I only want a stateful set pods to NAT , Is there a way to apply IP masquerade only for a stateful set and how to do it?  

0 1 281
1 REPLY 1

Hi @ishanC ,

Your best option here is to configure an Internal TCP/UDP load balancer. You can follow the Kubernetes Service annotation as described here on this documentation.

apiVersion: v1
kind: Service
metadata:
  name: ilb-svc
 
annotations:
    networking.gke.io/load-balancer-type: "Internal"
spec:
  type: LoadBalancer
 
externalTrafficPolicy: Cluster
 
selector:
    app: ilb-deployment
 
ports:
  - name: tcp-port
   
protocol: TCP
   
port: 8080
   
targetPort: 8080

 This is the exact excerpt from the documentation. You can rely on the Kubernetes config to get the Internal Load balancer up. 

Top Labels in this Space