新的K8 pods无法连接到SFTP服务器。

huangapple go评论61阅读模式
英文:

New K8 pods does not connect to SFTP server

问题

The new pod needs to include the host's public key in its configuration so that it can connect to the SFTP server successfully. This ensures that the pod's IP address is whitelisted in the SFTP server for authentication.

英文:

Currently, the application that is running as a containerized K8 spins up a new K8 pod every time and the new pod tries to connect to an sftp server.

Somehow the new pod always fails to connect to the sftp server and times out.
The instance or the IP address on which these pods are spun up has access to the sftp server and I am able to connect to the server using the command

sshpass -p password sftp user@ip-address

Every new pod tries to connect to the sftp server using the below script

 transport = paramiko.Transport((host, 22))
 transport.connect(username, assword, hostkey=None, pkey=none)
 connect = paramiko.SFTPClient.from_transport(transport)

Every time a new pod spins up, a new IP address is assigned to the pod, and that IP will not be whitelisted in the sftp server for it to make authentication - I think this is why it's not working.

What changes has to be included in the new pod so that it is able to connect to the sftp server? Should I include the public key of the host in the config map of the pod so that it uses that to connect to sftp?

答案1

得分: 0

安全组问题,一旦子网范围添加到安全组中,Pod 就能够访问 SFTP 服务器。

英文:

It was basically the security group issue. Once the subnet ranges are added to sec group, the pod was able to access the sftp server

huangapple
  • 本文由 发表于 2023年5月17日 15:23:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76269491.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定