[go: up one dir, main page]

Skip to content

An mcrouter image with helpful scripts for a Kubernetes-first environment with regards to discovery of memcached cluster nodes

Notifications You must be signed in to change notification settings

mangadex-pub/mcrouter-kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcrouter+memcache for Kubernetes

Summary

Facebook's mcrouter is a cool project for anyone with the need to horizontally scale caching clusters in dynamic environments like Kubernetes, where specific workload instances cannot expect unchanging internal IP addresses.

Finally, to achieve a truly dynamic setup is annoyingly verbose due to needing to regenerate JSON configuration files and diff them on a timer after doing a bunch of DNS lookups per memcached cluster.

Overall, this stuff's a pain and this repo aims to take care of it all for use-cases similar to ours.

Usage

Write your mcrouter configuration as you usually do, using dnssrv: prefix to get a dynamic list of servers in a pool based on a headless Kubernetes service.

For example, for headless service foo-headless in namespace memcache:

{
  "route": "PoolRoute|dynamic",
  "pools": {
    "dynamic": {
      "servers": [
        "dnssrv:_memcache._tcp.foo-headless.memcache.svc.cluster.local"
      ]
    }
  }
}

Limitations

  1. You cannot mix dynamic and static server entries in the same pool
  2. in-cluster IPv6 addressing is not supported
  3. These images are downstream of Wikipedia's images of mcrouter, as compiling mcrouter is currently exceedingly difficult, slow and resource-intensive ( see PR #449 and linked issues/PRs). Debated instead using a plain image, but the extra size of a full image for 2 shell scripts seemed a little silly, when one probably wants to use a readymade mcrouter image anyway de to how annoying it is to build.

About

An mcrouter image with helpful scripts for a Kubernetes-first environment with regards to discovery of memcached cluster nodes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages