Giter VIP home page Giter VIP logo

Comments (4)

atomantic avatar atomantic commented on September 26, 2024 1

Alright, since I don't need redis-trib to actually be installed on the redis nodes themselves, I changed my setup a little:

The statefulset now references redis:latest from docker hub

kubectl create -f config.yml
kubectl create -f service.yml
kubectl create -f statefulset.yml

# create redis-trib pod so we can join the redis pods together
kubectl run redistrib --image=zvelo/redis-trib --command -- tail -f /etc/hosts

# tell redistrib to join the pods
REDIS_PODS=$(kubectl get pods -l app=redis-cluster -o jsonpath='{range.items[*]}{.status.podIP}:6379 ')
REDISTRIB=$(kubectl get pods -l run=redistrib -o jsonpath='{range.items[*]}{.metadata.name}')

kubectl exec -it $REDISTRIB bash

# in sub-shell
./redis-trib.rb create --replicas 1 $REDIS_PODS

Then I can delete the redistrib deployment until I need it later (if I need it later).

Thanks for getting me started :)

from redis-cluster.

atomantic avatar atomantic commented on September 26, 2024

I'm not sure what the gem install redis was about so I removed that from the Dockerfile and it builds and runs. Also needed to install wget.

New Dockerfile

FROM redis
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update \
  && apt-get -y upgrade \
  && apt-get -y autoremove \
  && apt-get -y clean \
  && apt-get install -y wget
RUN wget -O /usr/local/bin/redis-trib http://download.redis.io/redis-stable/src/redis-trib.rb
RUN chmod 755 /usr/local/bin/redis-trib
CMD redis-server

from redis-cluster.

atomantic avatar atomantic commented on September 26, 2024

Ah! redis-trib needs redis :) so that doesn't totally work.

from redis-cluster.

sanderploegsma avatar sanderploegsma commented on September 26, 2024

Thanks for opening the issue, I wasn't aware that this had become an issue. Anyway, I believe the easiest solution would be to pin the redis gem to a version that works with the ruby version shipped with Jessie.

I particularly like your solution too, having a dedicated pod for redis-trib instead of shipping it with all the others. This way you can run it as needed and don't have a Dockerfile to maintain. Thanks!

from redis-cluster.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.