79208031

Date: 2024-11-20 16:06:57
Score: 1
Natty:
Report link

If you want it to be done with python, I would suggest this way:

import os
import socket

ip: str = socket.gethostbyname(os.environ["HOSTNAME"]

If you do not have your hostname in pod's environment, you can set pod name as a constant

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Alexander Grigorev