Hi, some API providers (e.g. for a database), allow you to configure a filter on their side to only accept traffic from certain IP address blocks.
Is there a reasonable way to restrict the set of IPs my k8s cluster uses when sending traffic outside of the cluster such that I could configure this list?
I’m aware this is support for reserved IPs, but not clear how integrated it is with k8s (https://docs.digitalocean.com/products/networking/reserved-ips/how-to/outbound-traffic/).
Or if not, possibly the DigitalOcean-wide set of IP addresses that may be used, thus limiting attacks to running on DigitalOcean?
Thanks!
Kyle
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
Indeed with Kubernetes, especially on cloud platforms like DigitalOcean, the outgoing traffic from the cluster typically originates from a range of IPs that are dynamically allocated by the cloud provider.
DigitalOcean does support reserved IPs, and these can be used to ensure that outbound traffic from your cluster comes from a predictable IP address. But that is mainly for Droplets.
To implement this with a DOKS cluster, one option would be to use a Static Routes Operator as described here:
Another option is to use an Egress Gateway via Crossplane with DigitalOcean CRD. Here is a guide on how to do that:
I could suggest testing this out on a staging or a test cluster before trying the implementation on your production environment!
Hope that this helps!
Best,
Bobby