External SNMP manager unable to reach snmp clients on k8s

2/14/2020

I have requirement for setting SNMP client running on Kubernetes pod from where i need to send traps to SNMP alarm manager which is not Kubernetes based. Now, there are two problems:

  1. SNMP trap client send alarm with source IP and if i have more than one client then they are reaching on SNMP Alarm manager from same source IP i.e worker node IP.

  2. SNMP Alarm Manager is sending trap to worker node IP on every 2 mins as per design and getting heartbeat failure as no SNMP client is running on worker node. As SNMP client is running on POD and for reaching pod in ingress we need Load balancer IP.

Now it would have been resolved if we could have set source IP as Load Balancer IP for SNMP alarm manager to get traps from same IP and send get to same Load Balancer IP.

Looking forward for your suggestions on it.

-- Rohit Sharma
kubernetes
kubernetes-ingress
kubernetes-pod
networking
snmp

1 Answer

2/14/2020

If you run your pods on hostNetwork(set the field hostNetwork: true in your pod template) then your pod's and worker node IP will be same. This will solve the problem where the reply from SNMP Alarm Manager got missed.

If you want to run multiple SNMP clients then you can run them on different worker nodes with hostNetwork and all of them will have different IP address.

-- anmol agrawal
Source: StackOverflow