Help with Connections from my website
I want to create a web application using a pod but I don't know how I can make connections from my website if every time I restart the pod the IP and TCP port mapping change. Any experience with this? Any tutorial? Thank you so much!
Solution:Jump to solution
IP and TCP port can be accessed from env variable
so you can figure something out to pass them into your other code
this...
9 Replies
Thank you!!! I'm going to look into this.
Solution
IP and TCP port can be accessed from env variable
so you can figure something out to pass them into your other code
this
Pod environment variables | RunPod Documentation
Configure and manage your pods with these essential environment variables, including pod ID, API key, host name, GPU and CPU count, public IP, SSH port, data center ID, volume ID, CUDA version, current working directory, PyTorch version, and public SSH key.
ur welcome
I just realized that I use storage for my pods so I create a pod every time I go out. I guess this approach won't work then, right?
I think it does, why not?
not clear of how do you use it
If I have not misunderstood when I create a pod again, the ip and port mapping changes. My website hosted on an external server cannot call the Runpod IP because it has changed and it does not know what IP my pod has. I can't access the environment variables from outside.
Ohh, access it from local, from the pod, python code will work too
The easiest way is to get your website's public ip and connect from your pod to your website
Just send it via http