|
| 1 | +version: '2' |
| 2 | + |
| 3 | +services: |
| 4 | + master: |
| 5 | + image: redis:${REDIS_VERSION}-alpine |
| 6 | + environment: |
| 7 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 8 | + stdin_open: true |
| 9 | + volumes: |
| 10 | + - redis-master:/data |
| 11 | + tty: true |
| 12 | + command: |
| 13 | + - redis-server |
| 14 | + - --appendonly |
| 15 | + - 'yes' |
| 16 | + - --masterauth |
| 17 | + - '${REDIS_PASSWORD}' |
| 18 | + - --requirepass |
| 19 | + - '${REDIS_PASSWORD}' |
| 20 | + labels: |
| 21 | + io.rancher.container.pull_image: always |
| 22 | + io.rancher.scheduler.affinity:host_label: '${REDIS_MASTER_HOST_LABEL}' |
| 23 | + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} |
| 24 | + |
| 25 | + slave: |
| 26 | + image: redis:${REDIS_VERSION}-alpine |
| 27 | + environment: |
| 28 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 29 | + stdin_open: true |
| 30 | + volumes: |
| 31 | + - redis-slave:/data |
| 32 | + tty: true |
| 33 | + command: |
| 34 | + - redis-server |
| 35 | + - --appendonly |
| 36 | + - 'yes' |
| 37 | + - --slaveof |
| 38 | + - master |
| 39 | + - '6379' |
| 40 | + - --masterauth |
| 41 | + - '${REDIS_PASSWORD}' |
| 42 | + - --requirepass |
| 43 | + - '${REDIS_PASSWORD}' |
| 44 | + labels: |
| 45 | + io.rancher.container.pull_image: always |
| 46 | + io.rancher.scheduler.affinity:host_label: '${REDIS_SLAVE_HOST_LABEL}' |
| 47 | + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} |
| 48 | + |
| 49 | + sentinel: |
| 50 | + image: lgatica/redis-sentinel:${REDIS_VERSION} |
| 51 | + environment: |
| 52 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 53 | + stdin_open: true |
| 54 | + tty: true |
| 55 | + links: |
| 56 | + - master:master |
| 57 | + ports: |
| 58 | + - '${REDIS_SENTINEL_PORT}':26379/tcp |
| 59 | + labels: |
| 60 | + io.rancher.container.pull_image: always |
| 61 | + io.rancher.scheduler.affinity:host_label: '${REDIS_SENTINEL_HOST_LABEL}' |
| 62 | + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} |
| 63 | + |
| 64 | + haproxy: |
| 65 | + image: rancher/lb-service-haproxy:v0.7.9 |
| 66 | + ports: |
| 67 | + - '${REDIS_HAPROXY_PORT}':6379/tcp |
| 68 | + labels: |
| 69 | + io.rancher.scheduler.affinity:host_label: '${REDIS_SENTINEL_HOST_LABEL}' |
| 70 | + io.rancher.container.agent.role: environmentAdmin |
| 71 | + io.rancher.container.create_agent: 'true' |
| 72 | + |
| 73 | +volumes: |
| 74 | + redis-master: |
| 75 | + external: true |
| 76 | + driver: rancher-ebs |
| 77 | + driver_opts: |
| 78 | + size: '${VOLUME_DRIVER_SIZE}' |
| 79 | + volumeType: '${VOLUME_DRIVER_TYPE}' |
| 80 | + ec2_az: '${VOLUME_DRIVER_AZ}' |
| 81 | + iops: '${VOLUME_DRIVER_IOPS}' |
| 82 | + |
| 83 | + redis-slave: |
| 84 | + external: true |
| 85 | + driver: rancher-ebs |
| 86 | + driver_opts: |
| 87 | + size: '${VOLUME_DRIVER_SIZE}' |
| 88 | + volumeType: '${VOLUME_DRIVER_TYPE}' |
| 89 | + ec2_az: '${VOLUME_DRIVER_AZ}' |
| 90 | + iops: '${VOLUME_DRIVER_IOPS}' |
0 commit comments