Get kubernetes node IP or label that agent is running on
We use kubernetes agents to run our pipelines. Does anyone know if there is a way to get what minion node the agent is running on without kubectl? Does the kubernetes plugin write an environment variable?
1
-
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 -
That's what I figured, thank you
0
Please sign in to leave a comment.
Comments
2 comments