Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.rst

Memcached with Prometheus Exporter for Kubernetes

This project shows how to run a memcached in your Kubernetes cluster. Memcached is stateless, so it is a pleasure to run it in K8S.

Our task is to create N memcaches instances, each of them needs to have its own kubernetes service and deployment. We cannot hide the memcache behind one service, because a memcached client has to know all the instances for fail-over and load-balancing.

Features:

  • Generate k8s configuration files for memcached shards
  • Memcached metrics exposed with a prometheus exporter

The opinionated parts:

  • Use Makefile,
  • Wrap kuberctl commands with Makefile tasks to enforce guards,
  • A guard that checks whether the intended TARGET_ENV matches a kubernetes cluster, you are logged in,
  • Use separate kubernetes clusters with postfix: development, staging, production (see guard_right_env in Makefile).

Howto

  1. Generate kubernetes config files for your environment (in tmp/$TARGET_ENV directory):

    NUM_SHARDS=2 TARGET_ENV=staging make kubernetes_generate_yml
    
  2. Create services:

    TARGET_ENV=staging make apply_service
    
  3. Create deployment:

    TARGET_ENV=staging make apply_service
    

About

An example of memcached deployment and service file for memcached

Topics

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.