Browse Source

02k8s-install-centos.sh

master
lizw 1 year ago
parent
commit
2b49cedb0a
  1. 10
      sd_dsl/02k8s-install-centos.sh

10
sd_dsl/02k8s-install-centos.sh

@ -1430,11 +1430,19 @@ function cert::renew() {
function init::node_config() { function init::node_config() {
local master_index=${master_index:-1} local master_index=${master_index:-1}
local worker_index=${worker_index:-1} local worker_index=${worker_index:-1}
# 获取MGMT_NODE机器的内网IP
if [[ "$MGMT_NODE" == "127.0.0.1" || "$MGMT_NODE_IP" == "" ]]; then
log::info "[init]" "Get $MGMT_NODE InternalIP." log::info "[init]" "Get $MGMT_NODE InternalIP."
command::exec "${MGMT_NODE}" " command::exec "${MGMT_NODE}" "
ip -4 route get 8.8.8.8 2>/dev/null | head -1 | awk '{print \$7}' ip -4 route get 8.8.8.8 2>/dev/null | head -1 | awk '{print \$7}'
" "
get::command_output "MGMT_NODE_IP" "$?" "exit" get::command_output "MGMT_NODE_IP" "$?" "exit"
if [[ "$MGMT_NODE" != "$MGMT_NODE_IP" ]]; then
log::warning "[init]" "ip不相同: $MGMT_NODE(MGMT_NODE) != $MGMT_NODE_IP(MGMT_NODE_IP)"
fi
else
MGMT_NODE_IP=$MGMT_NODE
fi
# master # master
for host in $MASTER_NODES for host in $MASTER_NODES
do do
@ -2798,6 +2806,8 @@ while [ "${1:-}" != "" ]; do
;; ;;
-U | --upgrade-kernel ) UPGRADE_KERNEL_TAG=1 -U | --upgrade-kernel ) UPGRADE_KERNEL_TAG=1
;; ;;
--mgmt-node-ip ) MGMT_NODE_IP="first_master_ip"
;;
-of | --offline-file ) shift -of | --offline-file ) shift
OFFLINE_TAG=1 OFFLINE_TAG=1
OFFLINE_FILE=${1:-$OFFLINE_FILE} OFFLINE_FILE=${1:-$OFFLINE_FILE}

Loading…
Cancel
Save