diff --git a/microk8s-resources/wrappers/run-kubelite-with-args b/microk8s-resources/wrappers/run-kubelite-with-args index 8762199981..4fe923b8a6 100755 --- a/microk8s-resources/wrappers/run-kubelite-with-args +++ b/microk8s-resources/wrappers/run-kubelite-with-args @@ -47,7 +47,7 @@ done if [ -e ${SNAP_DATA}/args/ha-conf ] then - storage_param="$(get_opt_in_config '--storage-dir' 'kube-apiserver')" + storage_param="$(get_opt_in_config '--storage-dir' 'k8s-dqlite')" storage_dir="$(eval echo $storage_param)" if $(grep -qE "^failure-domain" "${SNAP_DATA}/args/ha-conf"); then val="$(get_opt_in_config 'failure-domain' 'ha-conf')" diff --git a/snap/hooks/configure b/snap/hooks/configure index 8b7792c0ba..7b5fae4ef4 100755 --- a/snap/hooks/configure +++ b/snap/hooks/configure @@ -545,6 +545,12 @@ then refresh_opt_in_config etcd-servers unix://\${SNAP_DATA}/var/kubernetes/backend/kine.sock:12379 kube-apiserver skip_opt_in_config storage-backend kube-apiserver + + storage_dir="$(get_opt_in_config '--storage-dir' 'kube-apiserver')" + if ! [ -z $storage_dir ] + then + refresh_opt_in_config storage-dir "$storage_dir" k8s-dqlite + fi skip_opt_in_config storage-dir kube-apiserver snapctl restart ${SNAP_NAME}.daemon-k8s-dqlite