Merge "Update default values for docker nofile and vm.max_map_count"

This commit is contained in:
Zuul 2020-09-23 08:29:53 +00:00 committed by Gerrit Code Review
commit d03126ceba
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,9 @@ configure_storage_driver_generic() {
fi fi
if [ ${CONTAINER_RUNTIME} = "host-docker" ] ; then if [ ${CONTAINER_RUNTIME} = "host-docker" ] ; then
sed -i -E 's/^OPTIONS=("|'"'"')/OPTIONS=\1--storage-driver='$1' /' /etc/sysconfig/docker sed -i -E 's/^OPTIONS=("|'"'"')/OPTIONS=\1--storage-driver='$1' /' /etc/sysconfig/docker
# NOTE(flwang): The default nofile limit it too low, update it to
# match the default value in containerd
sed -i -E 's/--default-ulimit nofile=1024:1024/--default-ulimit nofile=1048576:1048576/' /etc/sysconfig/docker
fi fi
} }

View File

@ -29,6 +29,10 @@ _addtl_mounts=',{"type":"bind","source":"/opt/cni","destination":"/opt/cni","opt
if [ "$NETWORK_DRIVER" = "calico" ]; then if [ "$NETWORK_DRIVER" = "calico" ]; then
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
# NOTE(flwang): The default value for vm.max_map_count is too low, update
# it to 262144 to meet the minium requirement of Elasticsearch
echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
$ssh_cmd sysctl -p $ssh_cmd sysctl -p
if [ "$($ssh_cmd systemctl status NetworkManager.service | grep -o "Active: active")" = "Active: active" ]; then if [ "$($ssh_cmd systemctl status NetworkManager.service | grep -o "Active: active")" = "Active: active" ]; then
CALICO_NM=/etc/NetworkManager/conf.d/calico.conf CALICO_NM=/etc/NetworkManager/conf.d/calico.conf