How to get kubernetes pod's fullname by using C#

11/6/2021

I managed to make socket communication between kubernetes pods (with IPCluster services) by using C#. I want to place an additional restriction to this communication in terms accepted communication. For instance, server socket container will accept the communication that comes only from container(s) that contain(s) accepted service name within its fullname. I tried Dns.GetHostEntry for the new client communication but I am getting an exception as it couldn't find any hostname => null. Any idea how to get the pod/container fullname who initiate the communication with the server?

BTW, since I defined the pods services as IPCluster, do I need this kind of restriction? Based on this type, the communication will available only within the cluster itself, am I right?

-- iKKDev
c#
kubernetes

0 Answers