From 7e25ecd0a8356d4a9a14389e87180fcbde201cfd Mon Sep 17 00:00:00 2001 From: Serguei Bezverkhi Date: Mon, 17 Oct 2016 11:45:55 -0400 Subject: [PATCH] Adding custom api interface for keepalived This PS adds a possibility to override api_interface for a specific host, it is very usefull when hosts do not use the same NICs. It is done the same way as for neutron-openvswitch-agent. TrivialFix Change-Id: Ica173f75ba73272aa144e65d736936f5426a91d0 --- services/keepalived/keepalived-daemonset.yml.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/keepalived/keepalived-daemonset.yml.j2 b/services/keepalived/keepalived-daemonset.yml.j2 index c932955fd..e56103d58 100644 --- a/services/keepalived/keepalived-daemonset.yml.j2 +++ b/services/keepalived/keepalived-daemonset.yml.j2 @@ -24,6 +24,11 @@ spec: "sh", "-c", "cp -a /srv/configmap/..data/* /srv/pod-main-config/; + API_INTERFACE={{ api_interface }}; + F=/var/lib/kolla-kubernetes/keepalived/api_interface; + [ -f $F ] && API_INTERFACE=$(<$F); + sed -i ''s|interface.*|interface ''$API_INTERFACE''|g'' /srv/pod-main-config/keepalived.conf; + sed -i ''s|\\(dev*\\).*|\\1 ''$API_INTERFACE''|g'' /srv/pod-main-config/keepalived.conf; " ], "volumeMounts": [ { @@ -33,6 +38,10 @@ spec: { "name": "pod-main-config", "mountPath": "/srv/pod-main-config" + }, + { + "name": "host-var-lib-kk", + "mountPath": "/var/lib/kolla-kubernetes" } ] } @@ -73,3 +82,6 @@ spec: - name: host-run hostPath: path: /run + - name: host-var-lib-kk + hostPath: + path: /var/lib/kolla-kubernetes