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
This commit is contained in:
Serguei Bezverkhi 2016-10-17 11:45:55 -04:00
parent 8b4ef92852
commit 7e25ecd0a8
1 changed files with 12 additions and 0 deletions

View File

@ -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