fix: use direct BGD pod port 11717 instead of NodePort; remove conflicting SSH tunnel forward
This commit is contained in:
1 parent
49b38918ad
commit
33dd1c57af
1 file changed
+3
-4
@@ -129,7 +129,6 @@ $sshArgs = @(
|
|||||||
"-o", "ServerAliveInterval=30",
|
"-o", "ServerAliveInterval=30",
|
||||||
"-o", "ServerAliveCountMax=3",
|
"-o", "ServerAliveCountMax=3",
|
||||||
"-L", "${LocalPort}:localhost:${LocalPort}",
|
"-L", "${LocalPort}:localhost:${LocalPort}",
|
||||||
"-L", "${DirectorPort}:${ServerHost}:${DirectorPort}",
|
|
||||||
"-N", "${SSHUser}@${ServerHost}"
|
"-N", "${SSHUser}@${ServerHost}"
|
||||||
)
|
)
|
||||||
$sshTunnel = Start-Process ssh -ArgumentList $sshArgs -PassThru -WindowStyle Hidden
|
$sshTunnel = Start-Process ssh -ArgumentList $sshArgs -PassThru -WindowStyle Hidden
|
||||||
@@ -188,9 +187,9 @@ if ($pfCheckBgd) {
|
|||||||
$bgdMatch = ($pfCheckBgd -split "`n") | Where-Object { $_ -match 'bgd.*svc' } | Select-Object -First 1
|
$bgdMatch = ($pfCheckBgd -split "`n") | Where-Object { $_ -match 'bgd.*svc' } | Select-Object -First 1
|
||||||
if ($bgdMatch) { $bgdSvc = $bgdMatch -replace 'service/', '' }
|
if ($bgdMatch) { $bgdSvc = $bgdMatch -replace 'service/', '' }
|
||||||
}
|
}
|
||||||
Write-Host " Forwarding director port $DirectorPort -> ${ServerHost}:30822 (via bgd NodePort)..." -ForegroundColor Cyan
|
|
||||||
$directorRemotePort = 30822
|
$directorRemotePort = 11717
|
||||||
$directorCmd = 'nohup kubectl port-forward -n ' + $Namespace + ' svc/' + $bgdSvc + ' ' + $DirectorPort + ':' + $directorRemotePort + ' > /tmp/director_pf.log 2>&1 &'
|
$directorCmd = 'nohup sudo kubectl port-forward -n ' + $Namespace + ' svc/' + $bgdSvc + ' ' + $DirectorPort + ':' + $directorRemotePort + ' > /tmp/director_pf.log 2>&1 &'
|
||||||
$directorCmdEscaped = $directorCmd -replace '&', '`&'
|
$directorCmdEscaped = $directorCmd -replace '&', '`&'
|
||||||
$directorPf = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ' + $SSHUser + '@' + $ServerHost + ' "' + $directorCmdEscaped + '"'
|
$directorPf = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ' + $SSHUser + '@' + $ServerHost + ' "' + $directorCmdEscaped + '"'
|
||||||
cmd /c $directorPf
|
cmd /c $directorPf
|
||||||
|
|||||||
Reference in new issue
Block a user