Skip to main content

Get kubernetes node IP or label that agent is running on

Comments

2 comments

  • Allan Burdajewicz

    Hello Donald,

    You can use the environment variable 'NODE_NAME' and 'NODE_LABELS' to get respectively the name and the labels of the node.

    To get the pod IP, you can use a shell script:

    hostname -i

    But to get the host IP you would need to use kubectl.

    Regards,

    0
  • Donald Kallman

    That's what I figured, thank you

    0

Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.