Add Redis Sentinel
Introduce base container for redis Rebase the existing redis container on the new base container Provide a container for redis-sentinel to create a highly available cluster Change-Id: I683f02930a870c01dbc71c84060a65c72a8e568e
This commit is contained in:
parent
8cfdd01ec2
commit
4f903087e6
13
docker/redis/redis-base/Dockerfile.j2
Normal file
13
docker/redis/redis-base/Dockerfile.j2
Normal file
@ -0,0 +1,13 @@
|
||||
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
||||
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||
|
||||
{% block redis_base_header %}{% endblock %}
|
||||
|
||||
{% import "macros.j2" as macros with context %}
|
||||
|
||||
{{ macros.configure_user(name='redis', homedir='/run/redis') }}
|
||||
|
||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
||||
|
||||
{% block redis_base_footer %}{% endblock %}
|
9
docker/redis/redis-base/extend_start.sh
Normal file
9
docker/redis/redis-base/extend_start.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! -d "/var/log/kolla/redis" ]]; then
|
||||
mkdir -p /var/log/kolla/redis
|
||||
fi
|
||||
|
||||
if [[ $(stat -c %a /var/log/kolla/redis) != "755" ]]; then
|
||||
chmod 755 /var/log/kolla/redis
|
||||
fi
|
18
docker/redis/redis-sentinel/Dockerfile.j2
Normal file
18
docker/redis/redis-sentinel/Dockerfile.j2
Normal file
@ -0,0 +1,18 @@
|
||||
FROM {{ namespace }}/{{ image_prefix }}redis-base:{{ tag }}
|
||||
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||
|
||||
{% block redis_sentinel_header %}{% endblock %}
|
||||
|
||||
{% import "macros.j2" as macros with context %}
|
||||
|
||||
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
||||
{% set redis_sentinel_packages = ['redis'] %}
|
||||
{% elif base_distro in ['debian', 'ubuntu'] %}
|
||||
{% set redis_sentinel_packages = ['redis-sentinel'] %}
|
||||
{% endif %}
|
||||
{{ macros.install_packages(redis_sentinel_packages | customizable("packages")) }}
|
||||
|
||||
{% block redis_sentinel_footer %}{% endblock %}
|
||||
{% block footer %}{% endblock %}
|
||||
|
||||
USER redis
|
@ -1,12 +1,10 @@
|
||||
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
||||
FROM {{ namespace }}/{{ image_prefix }}redis-base:{{ tag }}
|
||||
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||
|
||||
{% block redis_header %}{% endblock %}
|
||||
|
||||
{% import "macros.j2" as macros with context %}
|
||||
|
||||
{{ macros.configure_user(name='redis', homedir='/run/redis') }}
|
||||
|
||||
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
||||
{% set redis_packages = ['redis'] %}
|
||||
{% elif base_distro in ['debian', 'ubuntu'] %}
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Add a redis-sentinel image to deploy highly available redis clusters
|
Loading…
Reference in New Issue
Block a user