1

I'm porting an application to k8s. The application currently consists of pairs of dockers, Trusted and Untrusted, where Trusted is connected to the regular bridge network and talks to internal services, while Untrusted is connected to a separate network allowing access only to external IPs. Untrusted accesses the network according to user-generated data, hence must have internet access and must not be able to access internal IPs.

Trusted and Untrusted communicate using a pair of FIFOs since they run on the same machine (Using a Unix Domain Socket was ~20% slower, I didn't yet test local TCP/IP but I suspect a bigger performance hit - the service is not entirely horizontally scalable due to ordering constraints so single-machine performance matters).

I've hit a wall porting this setup to k8s: the original idea was to use a Pod for each pair of dockers and using emptyDir to share the FIFOs, but there seems to be no way to create separate network limitations for a single container in a Pod since they all share a networking container. Is there a way to do this?

What's the alternative if this isn't possible? Setting up the untrusted containers in a separate namespace and applying a limited network access policy allowing only tightly-controlled access to the rest of the cluster?

Roee Shenberg
  • 1,457
  • 1
  • 13
  • 22
  • 1
    Hmm. Another option might be to run the Trusted containers in a DaemonSet. Then the Untrusted containers should still be able to talk with FIFOs to their local Trusted container using hostPath volumes. Also, in this model, each node hosting Untrusted containers is a DMZ. What do you do for Ingress? Should Untrusted containers be your ingress? – Jonah Benton Feb 19 '18 at 14:10
  • I started thinking along the lines of using pod affinity and a hostpath mount - this way I can have the untrusted pod have egress/ingress to publicly routable IP blocks only. That'll buy me time to figure out what to do with resource-aware scheduling once that arrives. – Roee Shenberg Feb 19 '18 at 15:40

0 Answers0