diff --git a/infra-templates/keepalived/0/1/docker-compose.yml b/infra-templates/keepalived/0/1/docker-compose.yml new file mode 100755 index 0000000..e110845 --- /dev/null +++ b/infra-templates/keepalived/0/1/docker-compose.yml @@ -0,0 +1,37 @@ +version: '2' +services: + keepalived-master: + restart: always + image: arcts/keepalived + network_mode: host + cap_add: + - NET_ADMIN + environment: + KEEPALIVED_AUTOCONF: true + KEEPALIVED_STATE: MASTER + KEEPALIVED_INTERFACE: eth0 + KEEPALIVED_VIRTUAL_ROUTER_ID: 2 + KEEPALIVED_UNICAST_SRC_IP: ${master_ip} + KEEPALIVED_UNICAST_PEER_0: ${backup_ip} + KEEPALIVED_TRACK_INTERFACE_1: eth0 + KEEPALIVED_VIRTUAL_IPADDRESS_1: "\"${virtual_ip}\"" + labels: + io.rancher.scheduler.affinity:host_label: ${host_label}=${master_host_label} + + keepalived-backup: + restart: always + image: arcts/keepalived + network_mode: host + cap_add: + - NET_ADMIN + environment: + KEEPALIVED_AUTOCONF: true + KEEPALIVED_STATE: BACKUP + KEEPALIVED_INTERFACE: eth0 + KEEPALIVED_VIRTUAL_ROUTER_ID: 2 + KEEPALIVED_UNICAST_SRC_IP: ${backup_ip} + KEEPALIVED_UNICAST_PEER_0: ${master_ip} + KEEPALIVED_TRACK_INTERFACE_1: eth0 + KEEPALIVED_VIRTUAL_IPADDRESS_1: "\"${virtual_ip}\"" + labels: + io.rancher.scheduler.affinity:host_label: ${host_label}=${backup_host_label} diff --git a/infra-templates/keepalived/0/1/rancher-compose.yml b/infra-templates/keepalived/0/1/rancher-compose.yml new file mode 100755 index 0000000..bd13ebc --- /dev/null +++ b/infra-templates/keepalived/0/1/rancher-compose.yml @@ -0,0 +1,40 @@ +.catalog: + name: "keepalived" + version: v1.0.0 + description: "Autostart Keepalived (ONLY IF YOU KNOW WHAT YOU'RE DOING)" + minimum_rancher_version: v0.46.0 + uuid: keepalived:v1.0.0 + questions: + - variable: host_label + label: "Keepalived Host Label" + description: "Host Label used to schedule keepalived master and backup instances" + type: "string" + default: "edge" + required: true + - variable: master_host_label + label: "Master Host Label" + description: "The value of the Keepalived Host Label to signifify the master instance" + type: "string" + default: "MASTER" + required: true + - variable: backup_host_label + label: "Backup Host Label" + description: "The value of the Keepalived Host Label to signifify the backup instance" + type: "string" + default: "BACKUP" + required: true + - variable: master_ip + description: "Host IP of master edge node" + label: "Master IP" + type: "string" + required: true + - variable: backup_ip + description: "Host IP of backup edge node" + label: "Backup IP" + type: "string" + required: true + - variable: virtual_ip + label: "Virtual IP" + description: "Virtual IP to be created." + type: "string" + required: true diff --git a/infra-templates/keepalived/0/docker-compose.yml b/infra-templates/keepalived/0/docker-compose.yml new file mode 100755 index 0000000..837b46f --- /dev/null +++ b/infra-templates/keepalived/0/docker-compose.yml @@ -0,0 +1,37 @@ +version: '2' +services: + keepalived-master: + restart: always + image: arcts/keepalived + network_mode: host + cap_add: + - NET_ADMIN + environment: + KEEPALIVED_AUTOCONF: true + KEEPALIVED_STATE: MASTER + KEEPALIVED_INTERFACE: eth0 + KEEPALIVED_VIRTUAL_ROUTER_ID: 2 + KEEPALIVED_UNICAST_SRC_IP: ${master_ip} + KEEPALIVED_UNICAST_PEER_0: ${backup_ip} + KEEPALIVED_TRACK_INTERFACE_1: eth0 + KEEPALIVED_VIRTUAL_IPADDRESS_1: "\"${virtual_ip}\"" + labels: + io.rancher.scheduler.affinity:host_label: edge=master + + keepalived-backup: + restart: always + image: arcts/keepalived + network_mode: host + cap_add: + - NET_ADMIN + environment: + KEEPALIVED_AUTOCONF: true + KEEPALIVED_STATE: BACKUP + KEEPALIVED_INTERFACE: eth0 + KEEPALIVED_VIRTUAL_ROUTER_ID: 2 + KEEPALIVED_UNICAST_SRC_IP: ${backup_ip} + KEEPALIVED_UNICAST_PEER_0: ${master_ip} + KEEPALIVED_TRACK_INTERFACE_1: eth0 + KEEPALIVED_VIRTUAL_IPADDRESS_1: "\"${virtual_ip}\"" + labels: + io.rancher.scheduler.affinity:host_label: edge=backup diff --git a/infra-templates/keepalived/0/rancher-compose.yml b/infra-templates/keepalived/0/rancher-compose.yml new file mode 100755 index 0000000..ebdf5ef --- /dev/null +++ b/infra-templates/keepalived/0/rancher-compose.yml @@ -0,0 +1,22 @@ +.catalog: + name: "keepalived" + version: v0.2.0 + description: "Autostart Keepalived (ONLY IF YOU KNOW WHAT YOU'RE DOING)" + minimum_rancher_version: v0.46.0 + uuid: keepalived:v0.2.0 + questions: + - variable: virtual_ip + label: "Virtual IP" + description: "Virtual IP in ip command format" + type: "string" + required: true + - variable: master_ip + description: "IP of master edge node" + label: "Master IP" + type: "string" + required: true + - variable: backup_ip + description: "IP of backup edge node" + label: "Backup IP" + type: "string" + required: true diff --git a/infra-templates/keepalived/README.md b/infra-templates/keepalived/README.md new file mode 100644 index 0000000..d97addd --- /dev/null +++ b/infra-templates/keepalived/README.md @@ -0,0 +1,12 @@ +## Keepalived +Manages VRRP failover + +### Usage + +This service is intended to be deployed to edge nodes with a MASTER and BACKUP deployed respectively. +Additional IPs should be managed via environment variables once deployed with entries following the below pattern: + +`KEEPALIVED_VIRTUAL_IPADDRESS_[0-9]{1,3}` + +Format should mimic the ip command +`10.255.33.100/24 dev eth0` diff --git a/infra-templates/keepalived/catalogIcon-keepalived.svg b/infra-templates/keepalived/catalogIcon-keepalived.svg new file mode 100644 index 0000000..7b82b7a --- /dev/null +++ b/infra-templates/keepalived/catalogIcon-keepalived.svg @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + ka + + + + diff --git a/infra-templates/keepalived/config.yml b/infra-templates/keepalived/config.yml new file mode 100755 index 0000000..6be3c47 --- /dev/null +++ b/infra-templates/keepalived/config.yml @@ -0,0 +1,7 @@ +name: keepalived +description: | + KeepaliveD, provides VRRP failover across multiple nodes +version: v1.0.0 +category: Networking +labels: + io.rancher.orchestration.supported: 'cattle,mesos,swarm,kubernetes'