How to add kubernates ingress and eggres rules

5/22/2018

I am newbie to Kubernetes, and I need to add some rules to the network policy:

  • Allow ingress traffic from the list of predefined IP addresses to specific ports.
  • Deny ingress traffic from private subnets.
  • Allow egress traffic to the Internet.
  • Deny egress traffic to private subnets.

I found some documents, but I couldn't find for internet.
And finally, how can I write this policy with Kubernetes java library?

-- Kemal Taskiran
kubernetes
kubernetes-ingress

1 Answer

5/23/2018

Kubernetes Network Policy is designed to restrict access inside the cluster, limiting access from pods to another pods and services.

If you need to restrict access from/to internet, it's better to use cloud provider capabilities or a physical device like:

To manage Kubernetes from java code you can use official java client library.

-- VAS
Source: StackOverflow