skip to Main Content

I am trying to add the redisbloom module to a redis helm chart (bitnami/redis), or ideally the redis cluster chart (bitnami/redis-cluster).

# Chart.yaml

apiVersion: v2
name: my-app
description: My app and redis (with redisbloom module loaded)
type: application
version: 0.1.0
appVersion: 0.1.0
dependencies:
  - name: redis
    alias: redisbloom
    version: 12.1.1
    repository: https://charts.bitnami.com/bitnami

Copying the compiled module redisbloom.so to each pod, and then loading the module either post-start or with master.command=redis-server --load-module=<path>/redisbloom.so seemed like it could be a potential solution – however from the documentation I can’t see how to copy the binary across for a chart.

I’m also not sure this would be enough on it’s own for a master-slave or cluster situation to work. This Github issue suggests it should be possible to do – but alas there is no documentation that I can find to support it.

Is it possible? Or would I need to create a custom chart, for example, using the RedisBloom docker image [redislabs/rebloom]?

Thanks in advance.

2

Answers


  1. I think you need to build custom redis image based on bitnami image with required module and after that use extraVars var to specify your module like: –loadmodule /usr/lib/redis/modules/redisearch.so

    My Dockerfile for that (I need to have redisearch module):

    #### My customization
    FROM redislabs/redisearch:latest AS moduleimg
    #### End of
    FROM docker.io/bitnami/minideb:buster
    LABEL maintainer "Bitnami <[email protected]>"
    
    ENV HOME="/" 
        OS_ARCH="amd64" 
        OS_FLAVOUR="debian-10" 
        OS_NAME="linux"
    
    COPY prebuildfs /
    # Install required system packages and dependencies
    RUN install_packages acl ca-certificates curl gzip libc6 libssl1.1 procps tar wget
    RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.0-3" --checksum 7521d9a4f9e4e182bf32977e234026caa7b03759799868335bccb1edd8f8fd12
    RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "redis" "6.2.1-0" --checksum c104089841a906f944e285828a580968608017340b67befaa1771646cbfdf6b3
    RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.12.0-2" --checksum 4d858ac600c38af8de454c27b7f65c0074ec3069880cb16d259a6e40a46bbc50
    RUN chmod g+rwX /opt/bitnami
    RUN ln -s /opt/bitnami/scripts/redis/entrypoint.sh /entrypoint.sh
    RUN ln -s /opt/bitnami/scripts/redis/run.sh /run.sh
    
    COPY rootfs /
    RUN /opt/bitnami/scripts/redis/postunpack.sh
    ENV BITNAMI_APP_NAME="redis" 
        BITNAMI_IMAGE_VERSION="6.2.1-debian-10-r14" 
        PATH="/opt/bitnami/common/bin:/opt/bitnami/redis/bin:$PATH"
    
    ### My customization
    RUN mkdir /opt/bitnami/redis/modules
    COPY --from=moduleimg /usr/lib/redis/modules/redisearch.so* /opt/bitnami/redis/modules
    ### End of
    
    EXPOSE 6379
    
    USER 1001
    ENTRYPOINT [ "/opt/bitnami/scripts/redis/entrypoint.sh" ]
    CMD [ "/opt/bitnami/scripts/redis/run.sh" ]
    
    Login or Signup to reply.
  2. I would use a custom image, for example:

    FROM redislabs/rebloom:latest as builder
    
    FROM bitnami/redis:6.2.10
    COPY --from=builder /usr/lib/redis/modules/redisbloom.so /usr/lib/redis/modules/redisbloom.so
    
    CMD ["/run.sh", "--loadmodule", "/usr/lib/redis/modules/redisbloom.so"]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search