mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-31 07:44:57 +08:00
fix(cluster): preserve hostGatewayIP across fast deploys
The fast deploy's helm upgrade was missing the hostGatewayIP value that the bootstrap entrypoint injects into the HelmChart CR. This caused host.openshell.internal hostAliases to be lost from the gateway pod and sandbox pods after any fast deploy, breaking host gateway routing. Read the IP from the HelmChart CR and pass it through to helm upgrade.
This commit is contained in:
@@ -405,6 +405,15 @@ if [[ "${needs_helm_upgrade}" == "1" ]]; then
|
||||
| cut -d'\"' -f4") || true
|
||||
SSH_HANDSHAKE_SECRET="${EXISTING_SECRET:-$(openssl rand -hex 32)}"
|
||||
|
||||
# Retrieve the host gateway IP from the entrypoint-rendered HelmChart CR so
|
||||
# that hostAliases for host.openshell.internal are preserved across fast deploys.
|
||||
HOST_GATEWAY_IP=$(cluster_exec "kubectl -n kube-system get helmchart openshell -o jsonpath='{.spec.valuesContent}' 2>/dev/null \
|
||||
| grep hostGatewayIP | awk '{print \$2}'" 2>/dev/null) || true
|
||||
HOST_GATEWAY_ARGS=""
|
||||
if [[ -n "${HOST_GATEWAY_IP}" ]]; then
|
||||
HOST_GATEWAY_ARGS="--set server.hostGatewayIP=${HOST_GATEWAY_IP}"
|
||||
fi
|
||||
|
||||
cluster_exec "helm upgrade openshell ${CONTAINER_CHART_DIR} \
|
||||
--namespace openshell \
|
||||
--set image.repository=${IMAGE_REPO_BASE}/gateway \
|
||||
@@ -415,6 +424,7 @@ if [[ "${needs_helm_upgrade}" == "1" ]]; then
|
||||
--set server.tls.clientCaSecretName=openshell-server-client-ca \
|
||||
--set server.tls.clientTlsSecretName=openshell-client-tls \
|
||||
--set server.sshHandshakeSecret=${SSH_HANDSHAKE_SECRET} \
|
||||
${HOST_GATEWAY_ARGS} \
|
||||
${helm_wait_args}"
|
||||
helm_end=$(date +%s)
|
||||
log_duration "Helm upgrade" "${helm_start}" "${helm_end}"
|
||||
|
||||
Reference in New Issue
Block a user