Docker image for running twemproxy with gcsfuse. Gcsfuse allows you to mount a Google Cloud Storage(GCS) bucket into container file system while running on Google Compute Engine(GCE) or Google Container Engine(GKE).
First put your twemproxy configuration file to a GCS bucket.
# nutcraker.yml
redis-pool:
listen: 0.0.0.0:22121
hash: fnv1a_64
distribution: ketama
auto_eject_hosts: true
redis: true
server_retry_timeout: 2000
server_failure_limit: 1
servers:
- <redis-addr>:6379:1
You can choose to run the container upon GCE directly.
# Pull the image.
$ docker pull xaviiic/twemproxy-gcsfuse
# Mount bucket to /etc/config and run.
$ docker run -it xaviiic/twemproxy-gcsfuse mkdir -p /etc/config \
&& gcsfuse <bucket_name> /etc/config && nutcracker -c /etc/config/nutcracker.yml
Or to deploy with k8s deployment script,
# twemproxy-gcsfuse-example.yaml
apiVersion: extensions/v1beta1
kind: Deployment
spec:
replicas: 1
template:
spec:
containers:
- name: example
image: xaviiic/twemproxy-gcsfuse:latest
securityContext:
privileged: true
command:
- "/bin/sh"
- "-c"
- "mkdir -p /etc/config && gcsfuse <bucket_name> /etc/config && nutcracker -c /etc/config/nutcraker.yml"
then apply to your cluster.
$ kubectl apply -f twemproxy-gcsfuse-example.yaml
- chiaen/docker-gcsfuse: For the gcsfuse binary.