add update sysctl setting

This commit is contained in:
Bob Killen 2017-08-03 08:50:15 -04:00
parent 21e91402d7
commit b7c07f27b8
No known key found for this signature in database
GPG Key ID: 03FB8A8615239E6D
3 changed files with 31 additions and 0 deletions

View File

@ -4,6 +4,7 @@ This catalog recipe enables unicast VRRP based failover for one or more floating
### Form Fields
* **Update Host Sysctl** - If `true` automatically sets the needed sysctl setting on the host.
* **Host Label Name** - Host label key name used to schedule keepalived master and backup instances.
* **Master Label** - The value of the keepalived host Label to signify the master instance.
* **Backup Label** - The value of the keepalived host Label to signify the backup instance.

View File

@ -17,6 +17,9 @@ services:
KEEPALIVED_VIRTUAL_IPADDRESS_1: "\"${virtual_ip}\""
labels:
io.rancher.scheduler.affinity:host_label: ${host_label}=${master_label}
{{- if eq .Values.update_sysctl "true" }}
io.rancher.sidekicks: keepalived-sysctl
{{- end}}
keepalived-backup:
restart: always
@ -35,3 +38,19 @@ services:
KEEPALIVED_VIRTUAL_IPADDRESS_1: "\"${virtual_ip}\""
labels:
io.rancher.scheduler.affinity:host_label: ${host_label}=${backup_label}
{{- if eq .Values.update_sysctl "true" }}
io.rancher.sidekicks: keepalived-sysctl
{{- end}}
{{- if eq .Values.update_sysctl "true" }}
keepalived-sysctl:
image: rawmind/alpine-sysctl:0.1-1
network_mode: none
privileged: true
environment:
SYSCTL_KEY: net.ipv4.ip_nonlocal_bind
SYSCTL_VALUE: 1
labels:
io.rancher.container.start_once: true
{{- end}}

View File

@ -5,6 +5,17 @@
minimum_rancher_version: v0.46.0
uuid: keepalived-1
questions:
- variable: "update_sysctl"
description: |
Set true to update sysctl.
WARN: If set to true, sysctl key net.ipv4.ip_nonlocal_bind will be set to 1.
label: "Update Host Sysctl:"
type: "enum"
default: "false"
options:
- "true"
- "false"
required: true
- variable: "host_label"
description: "Host label key name used to schedule keepalived master and backup instances."
label: "Host Label Name:"