Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions parts/linux/cloud-init/artifacts/cse_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -487,23 +487,20 @@ function nodePrep {
logs_to_events "AKS.CSE.setupAmdAma" setupAmdAma
fi

VALIDATION_ERR=0

# TODO(djsly): Look at leveraging the `aks-check-network.sh` script for this validation instead of duplicating the logic here

# Edge case scenarios:
# high retry times to wait for new API server DNS record to replicate (e.g. stop and start cluster)
# high timeout to address high latency for private dns server to forward request to Azure DNS
# dns check will be done only if we use FQDN for API_SERVER_NAME
API_SERVER_CONN_RETRIES=50
# shellcheck disable=SC3010
if [[ $API_SERVER_NAME == *.privatelink.* ]]; then
API_SERVER_CONN_RETRIES=100
fi
# TODO(djsly): Look at leveraging the `aks-check-network.sh` script for this validation instead of duplicating the logic here
VALIDATION_ERR=0
# shellcheck disable=SC3010
if ! [[ ${API_SERVER_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
API_SERVER_CONN_RETRIES=50
API_SERVER_DNS_RETRY_TIMEOUT=300
# shellcheck disable=SC3010
if [[ $API_SERVER_NAME == *.privatelink.* ]]; then
API_SERVER_CONN_RETRIES=100
API_SERVER_DNS_RETRY_TIMEOUT=600
Comment thread
cameronmeissner marked this conversation as resolved.
fi
if [ "${ENABLE_HOSTS_CONFIG_AGENT}" != "true" ]; then
Expand Down Expand Up @@ -531,7 +528,6 @@ function nodePrep {
API_SERVER_CONN_RETRIES=300
logs_to_events "AKS.CSE.apiserverNC" "retrycmd_if_failure ${API_SERVER_CONN_RETRIES} 1 10 nc -vz ${API_SERVER_NAME} 443" || time nc -vz ${API_SERVER_NAME} 443 || VALIDATION_ERR=$ERR_K8S_API_SERVER_CONN_FAIL
fi
Comment thread
cameronmeissner marked this conversation as resolved.

echo "API server connection check code: $VALIDATION_ERR"
if [ "$VALIDATION_ERR" -ne 0 ]; then
exit $VALIDATION_ERR
Expand Down
Loading