Change weavedb from an emptyDir to a hostPath volume

EmptyDir has the same lifetime as the pod, whereas we want our
persistence to extend past that, e.g. when Weave Net is upgraded.

`weave reset` cleans out the file.

We assume that /var/lib is writable.
This commit is contained in:
Bryan Boreham committed 2017-05-17 12:38:24 +00:00
1 parent 71d6e881f2
commit bebaa48520
4 files changed
+7 -3

No files matched your search

+2 -1
View File
@@ -126,7 +126,7 @@ docker_run_options() {
exec_options() {
case "$1" in
setup|setup-cni|launch)
setup|setup-cni|launch|reset)
echo -v /:/host -e HOST_ROOT=/host
;;
# All the other commands that may create the bridge and need machine id files.
@@ -1634,6 +1634,7 @@ case "$COMMAND" in
protect_against_docker_hang
VOLUME_CONTAINERS=$(docker ps -qa --filter label=weavevolumes)
[ -n "$VOLUME_CONTAINERS" ] && docker rm -v $VOLUME_CONTAINERS >/dev/null 2>&1 || true
rm -f $HOST_ROOT/var/lib/weave/weave-netdata.db >/dev/null 2>&1 || true
destroy_bridge
for LOCAL_IFNAME in $(ip link show | grep v${CONTAINER_IFNAME}pl | cut -d ' ' -f 2 | tr -d ':') ; do
ip link del ${LOCAL_IFNAME%@*} >/dev/null 2>&1 || true