Skip to content

Instantly share code, notes, and snippets.

@cedvan
Created December 15, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedvan/b1c97ada0ffe993d021317c4ad7d0497 to your computer and use it in GitHub Desktop.
Save cedvan/b1c97ada0ffe993d021317c4ad7d0497 to your computer and use it in GitHub Desktop.
version: '2'
services:
keepalived-master:
cap_add:
- NET_ADMIN
image: docker.cedvan.com/infra/keepalived:0.2.1
environment:
KEEPALIVED_INTERFACE: eth0
KEEPALIVED_PASSWORD: cedvanKeepalived
KEEPALIVED_PRIORITY: '1'
KEEPALIVED_UNICAST_PEERS: '#PYTHON2BASH:[''192.168.10.111'', ''192.168.10.112'']'
KEEPALIVED_VIRTUAL_IPS: 192.168.10.110
stdin_open: true
network_mode: host
tty: true
labels:
io.rancher.scheduler.affinity:host_label: keepalived=master,node=true
io.rancher.container.pull_image: always
io.rancher.scheduler.affinity:host_label_ne: keepalived=slave
io.rancher.scheduler.global: 'true'
keepalived-slave:
cap_add:
- NET_ADMIN
image: docker.cedvan.com/infra/keepalived:0.2.1
environment:
KEEPALIVED_INTERFACE: eth0
KEEPALIVED_PASSWORD: cedvanKeepalived
KEEPALIVED_PRIORITY: '2'
KEEPALIVED_UNICAST_PEERS: '#PYTHON2BASH:[''192.168.10.111'', ''192.168.10.112'']'
KEEPALIVED_VIRTUAL_IPS: 192.168.10.110
stdin_open: true
network_mode: host
tty: true
labels:
io.rancher.scheduler.affinity:host_label: keepalived=slave,node=true
io.rancher.container.pull_image: always
io.rancher.scheduler.affinity:host_label_ne: keepalived=master
io.rancher.scheduler.global: 'true'
http-redirect-to-https:
image: docker.cedvan.com/infra/nginx-https-redirect:latest
stdin_open: true
tty: true
ports:
- 80:80/tcp
labels:
io.rancher.container.pull_image: always
io.rancher.scheduler.affinity:host_label: node=true
version: '2'
services:
http-redirect-to-https:
scale: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment