Trying to get client real-ip to restrict some access at pod on kubernetes environemnt

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.8.2 and 1.18.6
Cloud being used: bare-meta
Installation method: kubeadm
Host OS: cent os 7
CNI and version: flannel
CRI and version: Docker

Hi I’m trying to get client real-ip to restrict some access at pod. But unfortunately I’m always getting 10.244.1.1 at every pod. I have tried with Using Source IP | Kubernetes but unfortunately no luck. Please help.

I’m using kubernetes 1.8.2 version on cent os 7 bare metal servers for kubernetes cluster. I do not have any choice but to use bare metal . As an ingress controller I’m using kong. My kong ingress controller is always getting 10.244.1.1. In kong there is a feature called IP restriction. I’m trying to use it.

So other suggested to use another kong hop as a loadbalancer which is not a good solution for my situation.

NAME                    STATUS   ROLES    AGE    VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION           CONTAINER-RUNTIME
master.kubernetes.com   Ready    master   119d   v1.18.2   ************   <none>        CentOS Linux 7 (Core)   3.10.0-1127.el7.x86_64   docker://19.3.8
node01.kubernetes.com   Ready    <none>   119d   v1.18.2   ************   <none>        CentOS Linux 7 (Core)   3.10.0-1127.el7.x86_64   docker://19.3.8
node02.kubernetes.com   Ready    <none>   119d   v1.18.2   *************  <none>        CentOS Linux 7 (Core)   3.10.0-1127.el7.x86_64   docker://19.3.8

I also tried with version v1.18.6 as well but unfortunately getting same result