|  | 
|  | 1 | +--- | 
|  | 2 | +version: '2' | 
|  | 3 | + | 
|  | 4 | +services: | 
|  | 5 | +  mongod: | 
|  | 6 | +    image: ${MONGO_VERSION} | 
|  | 7 | +    stdin_open: true | 
|  | 8 | +    tty: true | 
|  | 9 | +    volumes_from: | 
|  | 10 | +      - mongod-config | 
|  | 11 | +      - mongod-data | 
|  | 12 | +    labels: | 
|  | 13 | +      {{- if ne .Values.MONGOD_HOST_LABEL ""}} | 
|  | 14 | +      io.rancher.scheduler.affinity:host_label: ${MONGOD_HOST_LABEL} | 
|  | 15 | +      {{- end}} | 
|  | 16 | +      io.rancher.container.pull_image: always | 
|  | 17 | +      io.rancher.container.hostname_override: container_name | 
|  | 18 | +      io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} | 
|  | 19 | +      io.rancher.sidekicks: mongod-config, mongod-data | 
|  | 20 | +    environment: | 
|  | 21 | +      RS_NAME: '${MONGOD_RS_NAME}' | 
|  | 22 | +      MONGO_INITDB_ROOT_USERNAME: '${MONGO_INITDB_ROOT_USERNAME}' | 
|  | 23 | +      MONGO_INITDB_ROOT_PASSWORD: '${MONGO_INITDB_ROOT_PASSWORD}' | 
|  | 24 | +    {{- if and (eq .Values.MONGOS_ENABLED "true") (ne .Values.MONGOD_PORT "")}} | 
|  | 25 | +    ports: | 
|  | 26 | +      - '${MONGOD_PORT}:27017' | 
|  | 27 | +    {{- end}} | 
|  | 28 | +    entrypoint: /opt/rancher/bin/entrypoint-mongod.sh | 
|  | 29 | + | 
|  | 30 | +  mongod-config: | 
|  | 31 | +    image: lgatica/mongo-config | 
|  | 32 | +    stdin_open: true | 
|  | 33 | +    tty: true | 
|  | 34 | +    volumes: | 
|  | 35 | +      - /run/secrets | 
|  | 36 | +      - /opt/rancher/bin | 
|  | 37 | +    environment: | 
|  | 38 | +      MONGODB_KEYFILE_SECRET: '${MONGODB_KEYFILE}' | 
|  | 39 | +    labels: | 
|  | 40 | +      {{- if ne .Values.MONGOD_HOST_LABEL ""}} | 
|  | 41 | +      io.rancher.scheduler.affinity:host_label: ${MONGOD_HOST_LABEL} | 
|  | 42 | +      {{- end}} | 
|  | 43 | +      io.rancher.container.pull_image: always | 
|  | 44 | +      io.rancher.container.hostname_override: container_name | 
|  | 45 | +      io.rancher.container.start_once: 'true' | 
|  | 46 | + | 
|  | 47 | +  {{- if .Values.MONGOD_VOLUME_PATH}} | 
|  | 48 | +  mongod-data: | 
|  | 49 | +    image: busybox | 
|  | 50 | +    labels: | 
|  | 51 | +      {{- if ne .Values.MONGOD_HOST_LABEL ""}} | 
|  | 52 | +      io.rancher.scheduler.affinity:host_label: ${MONGOD_HOST_LABEL} | 
|  | 53 | +      {{- end}} | 
|  | 54 | +      io.rancher.container.hostname_override: container_name | 
|  | 55 | +      io.rancher.container.start_once: 'true' | 
|  | 56 | +    volumes: | 
|  | 57 | +      - {{.Values.MONGOD_VOLUME_PATH}}:/data/db | 
|  | 58 | +    entrypoint: /bin/true | 
|  | 59 | +  {{- end}} | 
|  | 60 | + | 
|  | 61 | +  {{- if eq .Values.ARBITER_ENABLED "true"}} | 
|  | 62 | +  arbiter: | 
|  | 63 | +    image: ${MONGO_VERSION} | 
|  | 64 | +    stdin_open: true | 
|  | 65 | +    tty: true | 
|  | 66 | +    volumes_from: | 
|  | 67 | +      - arbiter-config | 
|  | 68 | +      - arbiter-data | 
|  | 69 | +    labels: | 
|  | 70 | +      {{- if ne .Values.ARBITER_HOST_LABEL ""}} | 
|  | 71 | +      io.rancher.scheduler.affinity:host_label: ${ARBITER_HOST_LABEL} | 
|  | 72 | +      {{- end}} | 
|  | 73 | +      io.rancher.container.pull_image: always | 
|  | 74 | +      io.rancher.container.hostname_override: container_name | 
|  | 75 | +      io.rancher.sidekicks: arbiter-config, arbiter-data | 
|  | 76 | +    environment: | 
|  | 77 | +      RS_NAME: '${MONGOD_RS_NAME}' | 
|  | 78 | +      MONGO_INITDB_ROOT_USERNAME: '${MONGO_INITDB_ROOT_USERNAME}' | 
|  | 79 | +      MONGO_INITDB_ROOT_PASSWORD: '${MONGO_INITDB_ROOT_PASSWORD}' | 
|  | 80 | +    entrypoint: /opt/rancher/bin/entrypoint-arbiter.sh | 
|  | 81 | +    depends_on: | 
|  | 82 | +      - mongod | 
|  | 83 | + | 
|  | 84 | +  arbiter-config: | 
|  | 85 | +    image: lgatica/mongo-config | 
|  | 86 | +    stdin_open: true | 
|  | 87 | +    tty: true | 
|  | 88 | +    volumes: | 
|  | 89 | +      - /run/secrets | 
|  | 90 | +      - /opt/rancher/bin | 
|  | 91 | +    environment: | 
|  | 92 | +      MONGODB_KEYFILE_SECRET: '${MONGODB_KEYFILE}' | 
|  | 93 | +    labels: | 
|  | 94 | +      {{- if ne .Values.ARBITER_HOST_LABEL ""}} | 
|  | 95 | +      io.rancher.scheduler.affinity:host_label: ${ARBITER_HOST_LABEL} | 
|  | 96 | +      {{- end}} | 
|  | 97 | +      io.rancher.container.pull_image: always | 
|  | 98 | +      io.rancher.container.hostname_override: container_name | 
|  | 99 | +      io.rancher.container.start_once: 'true' | 
|  | 100 | + | 
|  | 101 | +  {{- if .Values.ARBITER_VOLUME_PATH}} | 
|  | 102 | +  arbiter-data: | 
|  | 103 | +    image: busybox | 
|  | 104 | +    labels: | 
|  | 105 | +      {{- if ne .Values.ARBITER_HOST_LABEL ""}} | 
|  | 106 | +      io.rancher.scheduler.affinity:host_label: ${ARBITER_HOST_LABEL} | 
|  | 107 | +      {{- end}} | 
|  | 108 | +      io.rancher.container.hostname_override: container_name | 
|  | 109 | +      io.rancher.container.start_once: 'true' | 
|  | 110 | +    volumes: | 
|  | 111 | +      - {{.Values.ARBITER_VOLUME_PATH}}:/data/db | 
|  | 112 | +    entrypoint: /bin/true | 
|  | 113 | +  {{- end}} | 
|  | 114 | +  {{- end}} | 
|  | 115 | + | 
|  | 116 | +  {{- if eq .Values.CONFIGSVR_ENABLED "true"}} | 
|  | 117 | +  configsvr: | 
|  | 118 | +    image: ${MONGO_VERSION} | 
|  | 119 | +    stdin_open: true | 
|  | 120 | +    tty: true | 
|  | 121 | +    volumes_from: | 
|  | 122 | +      - configsvr-config | 
|  | 123 | +      - configsvr-data | 
|  | 124 | +    labels: | 
|  | 125 | +      {{- if ne .Values.CONFIGSVR_HOST_LABEL ""}} | 
|  | 126 | +      io.rancher.scheduler.affinity:host_label: ${CONFIGSVR_HOST_LABEL} | 
|  | 127 | +      {{- end}} | 
|  | 128 | +      io.rancher.container.pull_image: always | 
|  | 129 | +      io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} | 
|  | 130 | +      io.rancher.container.hostname_override: container_name | 
|  | 131 | +      io.rancher.sidekicks: configsvr-config, configsvr-data | 
|  | 132 | +    environment: | 
|  | 133 | +      RS_NAME: '${CONFIGSVR_RS_NAME}' | 
|  | 134 | +      MONGO_INITDB_ROOT_USERNAME: '${MONGO_INITDB_ROOT_USERNAME}' | 
|  | 135 | +      MONGO_INITDB_ROOT_PASSWORD: '${MONGO_INITDB_ROOT_PASSWORD}' | 
|  | 136 | +    entrypoint: /opt/rancher/bin/entrypoint-configsvr.sh | 
|  | 137 | + | 
|  | 138 | +  configsvr-config: | 
|  | 139 | +    image: lgatica/mongo-config | 
|  | 140 | +    stdin_open: true | 
|  | 141 | +    tty: true | 
|  | 142 | +    volumes: | 
|  | 143 | +      - /run/secrets | 
|  | 144 | +      - /opt/rancher/bin | 
|  | 145 | +    environment: | 
|  | 146 | +      MONGODB_KEYFILE_SECRET: '${MONGODB_KEYFILE}' | 
|  | 147 | +    labels: | 
|  | 148 | +      {{- if ne .Values.CONFIGSVR_HOST_LABEL ""}} | 
|  | 149 | +      io.rancher.scheduler.affinity:host_label: ${CONFIGSVR_HOST_LABEL} | 
|  | 150 | +      {{- end}} | 
|  | 151 | +      io.rancher.container.pull_image: always | 
|  | 152 | +      io.rancher.container.hostname_override: container_name | 
|  | 153 | +      io.rancher.container.start_once: 'true' | 
|  | 154 | + | 
|  | 155 | +  {{- if .Values.CONFIGSVR_VOLUME_PATH}} | 
|  | 156 | +  configsvr-data: | 
|  | 157 | +    image: busybox | 
|  | 158 | +    labels: | 
|  | 159 | +      {{- if ne .Values.CONFIGSVR_HOST_LABEL ""}} | 
|  | 160 | +      io.rancher.scheduler.affinity:host_label: ${CONFIGSVR_HOST_LABEL} | 
|  | 161 | +      {{- end}} | 
|  | 162 | +      io.rancher.container.hostname_override: container_name | 
|  | 163 | +      io.rancher.container.start_once: 'true' | 
|  | 164 | +    volumes: | 
|  | 165 | +      - {{.Values.CONFIGSVR_VOLUME_PATH}}:/data/db | 
|  | 166 | +    entrypoint: /bin/true | 
|  | 167 | +  {{- end}} | 
|  | 168 | +  {{- end}} | 
|  | 169 | + | 
|  | 170 | +  {{- if eq .Values.MONGOS_ENABLED "true"}} | 
|  | 171 | +  mongos: | 
|  | 172 | +    image: ${MONGO_VERSION} | 
|  | 173 | +    stdin_open: true | 
|  | 174 | +    tty: true | 
|  | 175 | +    volumes_from: | 
|  | 176 | +      - mongos-config | 
|  | 177 | +    ports: | 
|  | 178 | +      - '${MONGOS_PORT}:27017' | 
|  | 179 | +    environment: | 
|  | 180 | +      MONGOD_RS_NAME: '${MONGOD_RS_NAME}' | 
|  | 181 | +      CONFIGSVR_RS_NAME: '${CONFIGSVR_RS_NAME}' | 
|  | 182 | +      MONGODB_DBNAME: '${MONGODB_DBNAME}' | 
|  | 183 | +      MONGO_INITDB_ROOT_USERNAME: '${MONGO_INITDB_ROOT_USERNAME}' | 
|  | 184 | +      MONGO_INITDB_ROOT_PASSWORD: '${MONGO_INITDB_ROOT_PASSWORD}' | 
|  | 185 | +    labels: | 
|  | 186 | +      {{- if ne .Values.MONGOS_HOST_LABEL ""}} | 
|  | 187 | +      io.rancher.scheduler.affinity:host_label: ${MONGOS_HOST_LABEL} | 
|  | 188 | +      {{- end}} | 
|  | 189 | +      io.rancher.container.pull_image: always | 
|  | 190 | +      io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} | 
|  | 191 | +      io.rancher.container.hostname_override: container_name | 
|  | 192 | +      io.rancher.sidekicks: mongos-config | 
|  | 193 | +    entrypoint: /opt/rancher/bin/entrypoint-mongos.sh | 
|  | 194 | +    depends_on: | 
|  | 195 | +      - mongod | 
|  | 196 | +      - configsvr | 
|  | 197 | + | 
|  | 198 | +  mongos-config: | 
|  | 199 | +    image: lgatica/mongo-config | 
|  | 200 | +    stdin_open: true | 
|  | 201 | +    tty: true | 
|  | 202 | +    volumes: | 
|  | 203 | +      - /run/secrets | 
|  | 204 | +      - /opt/rancher/bin | 
|  | 205 | +    environment: | 
|  | 206 | +      MONGODB_KEYFILE_SECRET: '${MONGODB_KEYFILE}' | 
|  | 207 | +    labels: | 
|  | 208 | +      {{- if ne .Values.MONGOS_HOST_LABEL ""}} | 
|  | 209 | +      io.rancher.scheduler.affinity:host_label: ${MONGOS_HOST_LABEL} | 
|  | 210 | +      {{- end}} | 
|  | 211 | +      io.rancher.container.pull_image: always | 
|  | 212 | +      io.rancher.container.hostname_override: container_name | 
|  | 213 | +      io.rancher.container.start_once: 'true' | 
|  | 214 | +  {{- end}} | 
0 commit comments