英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论