We are trying to connect to SFTP server from our .Net core code which is using Reci.SshNet.SftpClient package. We tested the code from our local and it works perfectly but when we move the same to our microk8s kubernetes cluster, we are getting timeout error – connection failed to establish within 30000 milliseconds
or Socket read operation has timed out after 30000 milliseconds
Even we have increased the timeout in our code to 90000 milliseconds, we are still getting 30000 milliseconds error.
using (SftpClient client = new SftpClient(sftpHost, sftpPort, sftpUserName, sftpPassword))
{
client.OperationTimeout = TimeSpan.FromMilliseconds(90000);
client.Connect();
// sftp code
}