diff --git a/parts/k8s/kubernetescustomscript.sh b/parts/k8s/kubernetescustomscript.sh index a44cd313cf..46eda03d86 100644 --- a/parts/k8s/kubernetescustomscript.sh +++ b/parts/k8s/kubernetescustomscript.sh @@ -24,6 +24,8 @@ ERR_K8S_RUNNING_TIMEOUT=30 # Timeout waiting for k8s cluster to be healthy ERR_K8S_DOWNLOAD_TIMEOUT=31 # Timeout waiting for Kubernetes download(s) ERR_KUBECTL_NOT_FOUND=32 # kubectl client binary not found on local disk ERR_CNI_DOWNLOAD_TIMEOUT=41 # Timeout waiting for CNI download(s) +ERR_MS_PROD_DEB_DOWNLOAD_TIMEOUT=42 # Timeout waiting for https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb +ERR_MS_PROD_DEB_PKG_ADD_FAIL=43 # Failed to add repo pkg file ERR_OUTBOUND_CONN_FAIL=50 # Unable to establish outbound connection ERR_CUSTOM_SEARCH_DOMAINS_FAIL=80 # Unable to configure custom search domains ERR_APT_DAILY_TIMEOUT=98 # Timeout waiting for apt daily updates @@ -154,13 +156,15 @@ function installEtcd() { } function installDeps() { + retrycmd_if_failure_no_stats 20 1 5 curl -fsSL https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb > /tmp/packages-microsoft-prod.deb || exit $ERR_MS_PROD_DEB_DOWNLOAD_TIMEOUT + retrycmd_if_failure 10 5 3 dpkg -i /tmp/packages-microsoft-prod.deb || exit $ERR_MS_PROD_DEB_PKG_ADD_FAIL echo `date`,`hostname`, apt-get_update_begin>>/opt/m - apt_get_update || exit $ERR_APT_INSTALL_TIMEOUT + apt_get_update || exit $ERR_APT_UPDATE_TIMEOUT echo `date`,`hostname`, apt-get_update_end>>/opt/m # make sure walinuxagent doesn't get updated in the middle of running this script retrycmd_if_failure 20 5 30 apt-mark hold walinuxagent || exit $ERR_HOLD_WALINUXAGENT # See https://github.com/kubernetes/kubernetes/blob/master/build/debian-hyperkube-base/Dockerfile#L25-L44 - apt_get_install 20 30 300 apt-transport-https ca-certificates iptables iproute2 ebtables socat util-linux mount ethtool init-system-helpers nfs-common ceph-common conntrack glusterfs-client ipset jq cgroup-lite git pigz xz-utils || exit $ERR_APT_INSTALL_TIMEOUT + apt_get_install 20 30 300 apt-transport-https ca-certificates iptables iproute2 ebtables socat util-linux mount ethtool init-system-helpers nfs-common ceph-common conntrack glusterfs-client ipset jq cgroup-lite git pigz xz-utils blobfuse fuse || exit $ERR_APT_INSTALL_TIMEOUT systemctlEnableAndStart rpcbind systemctlEnableAndStart rpc-statd } diff --git a/parts/k8s/kubernetesprovisionsource.sh b/parts/k8s/kubernetesprovisionsource.sh index 58083ab71e..e722acdb3a 100644 --- a/parts/k8s/kubernetesprovisionsource.sh +++ b/parts/k8s/kubernetesprovisionsource.sh @@ -58,6 +58,7 @@ apt_get_update() { apt_update_output=/tmp/apt-get-update.out for i in $(seq 1 $retries); do timeout 30 dpkg --configure -a + timeout 30 apt-get -f -y install timeout 120 apt-get update 2>&1 | tee $apt_update_output | grep -E "^([WE]:.*)|([eE]rr.*)$" [ $? -ne 0 ] && cat $apt_update_output && break || \ cat $apt_update_output