expose a static public IP for outbound traffic

Posted September 4, 2020 1.6k views
NetworkingKubernetesDigitalOcean Managed Kubernetes

Hi, I’m new to DO. Our company is mounting its applications on this platform with Kubernetes and we have a problem communicating with a database on an external network because this other network must give permissions to a static IP for requests. I have been looking for and I understand that this is achieved with NAT, specifically implement this manual
(Configure IP Forwarding & Configure NAT). I did this but I can’t connect to the gateway of each droplet (we have 2 droplets) (Droplet-> Networking-> Public Gateway), I did a ping but they don’t respond. Why is this happening? Is it possible to do what I comment on the problem? Sorry I’m a rookie.

edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

@miguelDolphin From the information provided, it’s unclear on what errors you’re receiving when trying to connect to the DB at this time. Also, what’s your general Kubernetes architecture for connecting to the DB? Is the app attempting to access the remote DB through a Kubernetes service resource (i.e. ClusterIP or ExternalName) within the cluster? Next, is the DB hosted by self or a 3rd party service provider? Finally, does the DB exist within another Kubernetes cluster? In short, it would help others to better understand your issue with a bit more detail. If you have the steps to reproduce your current issue, it would be very helpful.

Think different and code well,


  • Hello, thanks for answering. Now again I have this problem.
    Basically I have a DO cluster and the application is in a pod, nothing more than that. The external database is installed on a company server, with a static ip. I do not occupy a service with clusterIp or externalName as you mentioned … and when executing the application I get a timeout error