Report this

What is the reason for this report?

Private networking seems slow when Kubernetes pulls from my private docker registry.

Posted on November 11, 2019

My Current Setup

  1. Kubernetes cluster with two nodes. Each node is 1vcpu and 2GB of RAM. ($10/mo per node * 2 nodes = $20/mo)
  2. A single Droplet with 1vcpu and 2GB of RAM. ($10/mo)
  3. The Droplet has a private IP, and is in the same region as the cluster.

Docker Registry

The Droplet hosts a private docker registry. The private docker registry has tls enabled. I use a wildcard certificate because I have two subdomains to my domain:

  • subdomain1.mydomain.com points to my droplet’s public IP, so I can push new images to it
  • subdomain2.mydomain.com points to my droplet’s private IP, and the Kubernetes cluster has a secret set such that it will pull images over the private network.

The private docker registry runs inside of a docker container on the droplet. The private docker registry listens on 0.0.0.0:443, which allows it to receive connections from the private AND public ip. I used the droplet metrics to confirm that the cluster was indeed pulling the images over the private network and not over the public network.

The Problem

All connections work, but the private communications are quite slow (only about 16mbps at best). Additionally, if I launch two pods on the K8s cluster simultaneously, where both pods need to pull an image, one pod will timeout and the other pod will successfully pull the image. The cluster will retry pulling the second image a couple minutes later and will be able to pull the image successfully.

I suspect the timeout problem is something I need to fix myself in the docker registry config, but 16mbps seems kinda slow for private networking on Digital Ocean. If I’m going to keep using Digital Ocean for my current project, I’m going to need a strong private network. My current project relies on a TON of communications between nodes in a cluster.

Additional Test

Finally I did one more test. I temporarily created a second droplet with private networking enabled (1vcpu 2GB RAM) and used docker to pull two images simultaneously from the docker registry. I managed to pull at a speed of around 25.4mbps. Neither of the pulls timed out. Still, the speed of only 25.4mbps seems slow.



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.

Hello,

Wonder if you have tried using the VPC networks for this setup and see if the performance improves?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.