|
| 1 | +version: '2' |
| 2 | + |
| 3 | +services: |
| 4 | + redis: |
| 5 | + image: ${REDIS_VERSION} |
| 6 | + environment: |
| 7 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 8 | + ports: |
| 9 | + - ${REDIS_PORT}:6379/tcp |
| 10 | + stdin_open: true |
| 11 | + tty: true |
| 12 | + labels: |
| 13 | + {{- if ne .Values.REDIS_SERVER_HOST_LABEL ""}} |
| 14 | + io.rancher.scheduler.affinity:host_label: ${REDIS_SERVER_HOST_LABEL} |
| 15 | + {{- end}} |
| 16 | + io.rancher.container.pull_image: always |
| 17 | + io.rancher.sidekicks: redis-config{{- if ne .Values.REDIS_VOLUME_PATH ""}}, redis-data{{- end}} |
| 18 | + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} |
| 19 | + io.rancher.container.hostname_override: container_name |
| 20 | + volumes_from: |
| 21 | + - redis-config |
| 22 | + {{- if ne .Values.REDIS_VOLUME_PATH ""}} |
| 23 | + - redis-data |
| 24 | + {{- end}} |
| 25 | + entrypoint: /opt/redis/scripts/server-entrypoint.sh |
| 26 | + command: |
| 27 | + - "redis-server" |
| 28 | + - "/usr/local/etc/redis/redis.conf" |
| 29 | + |
| 30 | + sentinel: |
| 31 | + image: ${REDIS_VERSION} |
| 32 | + environment: |
| 33 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 34 | + SENTINEL_QUORUM: '${SENTINEL_QUORUM}' |
| 35 | + SENTINEL_DOWN_AFTER: '${SENTINEL_DOWN_AFTER}' |
| 36 | + SENTINEL_FAILOVER: '${SENTINEL_FAILOVER}' |
| 37 | + ports: |
| 38 | + - ${SENTINEL_PORT}:26379/tcp |
| 39 | + stdin_open: true |
| 40 | + tty: true |
| 41 | + labels: |
| 42 | + io.rancher.container.pull_image: always |
| 43 | + {{- if ne .Values.REDIS_SENTINEL_HOST_LABEL ""}} |
| 44 | + io.rancher.scheduler.affinity:host_label: ${REDIS_SENTINEL_HOST_LABEL} |
| 45 | + {{- end}} |
| 46 | + io.rancher.sidekicks: sentinel-config{{- if ne .Values.SENTINEL_VOLUME_PATH ""}}, sentinel-data{{- end}} |
| 47 | + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} |
| 48 | + io.rancher.container.hostname_override: container_name |
| 49 | + volumes_from: |
| 50 | + - sentinel-config |
| 51 | + {{- if ne .Values.SENTINEL_VOLUME_PATH ""}} |
| 52 | + - sentinel-data |
| 53 | + {{- end}} |
| 54 | + entrypoint: /opt/redis/scripts/sentinel-entrypoint.sh |
| 55 | + command: |
| 56 | + - "redis-server" |
| 57 | + - "/usr/local/etc/redis/sentinel.conf" |
| 58 | + - "--sentinel" |
| 59 | + |
| 60 | + redis-config: |
| 61 | + image: lgatica/redis-config:1 |
| 62 | + environment: |
| 63 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 64 | + stdin_open: true |
| 65 | + tty: true |
| 66 | + volumes: |
| 67 | + - /usr/local/etc/redis |
| 68 | + - /opt/redis/scripts |
| 69 | + labels: |
| 70 | + {{- if ne .Values.REDIS_SERVER_HOST_LABEL ""}} |
| 71 | + io.rancher.scheduler.affinity:host_label: ${REDIS_SERVER_HOST_LABEL} |
| 72 | + {{- end}} |
| 73 | + io.rancher.container.pull_image: always |
| 74 | + io.rancher.container.hostname_override: container_name |
| 75 | + io.rancher.container.start_once: 'true' |
| 76 | + entrypoint: /bin/true |
| 77 | + |
| 78 | + sentinel-config: |
| 79 | + image: lgatica/redis-config:2 |
| 80 | + environment: |
| 81 | + REDIS_PASSWORD: '${REDIS_PASSWORD}' |
| 82 | + stdin_open: true |
| 83 | + tty: true |
| 84 | + volumes: |
| 85 | + - /usr/local/etc/redis |
| 86 | + - /opt/redis/scripts |
| 87 | + labels: |
| 88 | + {{- if ne .Values.REDIS_SENTINEL_HOST_LABEL ""}} |
| 89 | + io.rancher.scheduler.affinity:host_label: ${REDIS_SENTINEL_HOST_LABEL} |
| 90 | + {{- end}} |
| 91 | + io.rancher.container.pull_image: always |
| 92 | + io.rancher.container.hostname_override: container_name |
| 93 | + io.rancher.container.start_once: 'true' |
| 94 | + entrypoint: /bin/true |
| 95 | + |
| 96 | + {{- if .Values.REDIS_VOLUME_PATH}} |
| 97 | + redis-data: |
| 98 | + image: busybox |
| 99 | + labels: |
| 100 | + {{- if ne .Values.REDIS_SERVER_HOST_LABEL ""}} |
| 101 | + io.rancher.scheduler.affinity:host_label: ${REDIS_SERVER_HOST_LABEL} |
| 102 | + {{- end}} |
| 103 | + io.rancher.container.hostname_override: container_name |
| 104 | + io.rancher.container.start_once: 'true' |
| 105 | + volumes: |
| 106 | + - {{.Values.REDIS_VOLUME_PATH}}:/data |
| 107 | + entrypoint: /bin/true |
| 108 | + {{- end}} |
| 109 | + |
| 110 | + {{- if .Values.SENTINEL_VOLUME_PATH}} |
| 111 | + sentinel-data: |
| 112 | + image: busybox |
| 113 | + labels: |
| 114 | + {{- if ne .Values.REDIS_SENTINEL_HOST_LABEL ""}} |
| 115 | + io.rancher.scheduler.affinity:host_label: ${REDIS_SENTINEL_HOST_LABEL} |
| 116 | + {{- end}} |
| 117 | + io.rancher.container.hostname_override: container_name |
| 118 | + io.rancher.container.start_once: 'true' |
| 119 | + volumes: |
| 120 | + - {{.Values.SENTINEL_VOLUME_PATH}}:/data |
| 121 | + entrypoint: /bin/true |
| 122 | + {{- end}} |
0 commit comments