I'm getting the node IP address instead of the client IP. Is it possible to get the client IP with a service of type LoadBalancer
? Or will I need to use a ingress controller?
apiVersion: v1
kind: Service
metadata:
name: app-svc
labels:
name: app-svc
environment: dev
spec:
type: LoadBalancer
loadBalancerIP: XXX.XXX.XXX.XXX
ports:
- name: http-port
port: 80
targetPort: 80
protocol: TCP
selector:
name: app-deploy
kubectl edit svs/pentagon-balancer
and just changeCluster
toLocal
. Now I can see real user IP inX-Forwarded-For
header on backend – Consequential