Permalink
Browse files

Merge pull request #692 from amazeeio/redis-persistent

redis service with persistent volume
  • Loading branch information...
Schnitzel committed Oct 24, 2018
2 parents 617503b + 8d5a6d0 commit 687f0c439310be982e773223d04afa432931e87f
View
@@ -160,7 +160,7 @@ build/nginx-drupal: build/nginx images/nginx-drupal/Dockerfile
build/varnish: build/commons images/varnish/Dockerfile
build/varnish-drupal: build/varnish images/varnish-drupal/Dockerfile
build/redis: build/commons images/redis/Dockerfile
build/redis-persistent: build/commons images/redis-persistent/Dockerfile
build/redis-persistent: build/redis images/redis-persistent/Dockerfile
build/mongo: build/commons images/mongo/Dockerfile
build/elasticsearch: build/commons images/elasticsearch/Dockerfile
build/logstash: build/commons images/logstash/Dockerfile
@@ -697,3 +697,4 @@ rebuild-push-oc-build-deploy-dind:
.PHONY: ui-development
ui-development: build/api build/api-db build/local-api-data-watcher-pusher build/ui build/keycloak build/keycloak-db
IMAGE_REPO=$(CI_BUILD_TAG) docker-compose -p $(CI_BUILD_TAG) up -d api api-db local-api-data-watcher-pusher ui keycloak keycloak-db
@@ -0,0 +1,57 @@
apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
name: lagoon-openshift-template-redis
parameters:
- name: SERVICE_NAME
description: Name of this service
required: true
- name: SAFE_BRANCH
description: Which branch this belongs to, special chars replaced with dashes
required: true
- name: SAFE_PROJECT
description: Which project this belongs to, special chars replaced with dashes
required: true
- name: BRANCH
description: Which branch this belongs to, original value
required: true
- name: PROJECT
description: Which project this belongs to, original value
required: true
- name: LAGOON_GIT_SHA
description: git hash sha of the current deployment
required: true
- name: SERVICE_ROUTER_URL
description: URL of the Router for this service
value: ""
- name: OPENSHIFT_PROJECT
description: Name of the Project that this service is in
required: true
- name: REGISTRY
description: Registry where Images are pushed to
required: true
- name: PERSISTENT_STORAGE_PATH
description: Full path to which should be mounted into persistent storage
required: true
- name: PERSISTENT_STORAGE_CLASS
description: Name of the Storage Class to use
value: "bulk"
- name: PERSISTENT_STORAGE_SIZE
description: Size of the Storage to request
value: "1Gi"
- name: DEPLOYMENT_STRATEGY
description: Strategy of Deploymentconfig
value: "Rolling"
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SERVICE_NAME}
spec:
accessModes:
- ReadWriteOnce
storageClassName: "${PERSISTENT_STORAGE_CLASS}"
resources:
requests:
storage: ${PERSISTENT_STORAGE_SIZE}
@@ -1,28 +1,4 @@
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/commons as commons
FROM redis:alpine
FROM ${IMAGE_REPO:-lagoon}/redis
MAINTAINER amazee.io
ENV LAGOON=redis
# Copying commons files
COPY --from=commons /lagoon /lagoon
COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/
COPY --from=commons /sbin/tini /sbin/
COPY --from=commons /home /home
RUN chmod g+w /etc/passwd \
&& mkdir -p /home
# When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV`
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
ENV TMPDIR=/tmp TMP=/tmp HOME=/home ENV=/home/.bashrc BASH_ENV=/home/.bashrc
COPY redis.conf /etc/redis/redis.conf
COPY docker-entrypoint /lagoon/entrypoints/70-redis-entrypoint
RUN fix-permissions /etc/redis/redis.conf \
fix-permissions /data
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.sh"]
CMD ["redis-server", "/etc/redis/redis.conf"]
ENV FLAVOR=persistent

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
View
@@ -4,6 +4,7 @@ FROM redis:alpine
LABEL maintainer="amazee.io"
ENV LAGOON=redis
ENV FLAVOR=ephemeral
# Copy commons files
COPY --from=commons /lagoon /lagoon
@@ -22,11 +23,11 @@ ENV TMPDIR=/tmp \
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
BASH_ENV=/home/.bashrc
COPY redis.conf /etc/redis/redis.conf
COPY conf /etc/redis/
COPY docker-entrypoint /lagoon/entrypoints/70-redis-entrypoint
RUN fix-permissions /etc/redis/redis.conf \
RUN fix-permissions /etc/redis \
fix-permissions /data
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.sh"]
CMD ["redis-server", "/etc/redis/redis.conf"]
CMD ["redis-server", "/etc/redis/redis.conf"]
@@ -0,0 +1,4 @@
# this disabled the persistent cache
save ""
appendonly no
@@ -0,0 +1,12 @@
save 900 1
save 300 10
save 60 10000
# RDB files created with checksum disabled have a checksum of zero that will
# tell the loading code to skip the check.
rdbchecksum yes
# The filename where to dump the DB
dbfilename redis.rdb
dir /data
@@ -11,6 +11,4 @@ maxmemory-policy allkeys-lru
protected-mode no
bind 0.0.0.0
# this disabled the persistent cache
save ""
appendonly no
include /etc/redis/${FLAVOR:-ephemeral}.conf

0 comments on commit 687f0c4

Please sign in to comment.