Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mlaccetti/mcrouter-kubernetes-provisioner
Create and update mcrouter configs on the fly as memcached instances are deployed
https://github.com/mlaccetti/mcrouter-kubernetes-provisioner
kubernetes kubernetes-deployment mcrouter memcached
Last synced: 5 days ago
JSON representation
Create and update mcrouter configs on the fly as memcached instances are deployed
- Host: GitHub
- URL: https://github.com/mlaccetti/mcrouter-kubernetes-provisioner
- Owner: mlaccetti
- Created: 2017-02-28T19:33:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T22:30:07.000Z (over 7 years ago)
- Last Synced: 2024-10-12T10:25:44.695Z (about 1 month ago)
- Topics: kubernetes, kubernetes-deployment, mcrouter, memcached
- Language: Go
- Size: 18.7 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mcrouter-k8s-provisioner
A mechanism to automatically configure Facebook's Mcrouter based on adding/removing memcached pods.
In simple terms, it'll automatically re-create the `mcrouter` config file for a bunch of `memcached` instances managed
through a Kubernetes deployment. The information for which `memcached` instances are available to put into the config is
extracted via DNS lookup in Kubernetes.### FIXME
Make sure we also trap the port
### Usage
Please see the `example` directory to see how this all works.
Pre-conditions:
- You have deployed the persistent volume
- You have deployed the persistent volume claimIf you don't have an NFS server available for testing, you can use the example `nfs-server.` Make sure you modify the persistent volume to use the correct IP.
First, deploy the `mcrouter-provisioner` - it'll mount the volume, create an empty config, and start listening for pod
creation/removal events. As `memcached` pods come online, it'll grab their info and update the `mcrouter` config file.
We are using a `deployment` as we want to ensure that one instance is always running.Second, deploy a bunch of `memcached` nodes using a deployment and a headless service. We specifically want the headless
service so that we can look up all the nodes in Kubernetes' DNS.Last, setup a Kubernetes deployment using `jamescarr/mcrouter` as the image, this time with a proper service. These
nodes all need a persistent volume to read the same configuration file from. When you build a service that requires
memcached, you will point it to this service, and one of the `mcrouter` instances will handle the request and route
to one of the `memcached` instances appropriately.### Developing
Make sure you have the `dep` tool installed:
```
go get -u github.com/golang/dep/...
```Next, make sure you install the dependencies we need:
```
dep ensure
```Finally, build the app:
```
go build -o mcrouter-k8s-provisioner main.go
```