Skip to content

Instantly share code, notes, and snippets.

@iocanel
Created January 21, 2016 09:28
Show Gist options
  • Save iocanel/7c41003744b88830dd27 to your computer and use it in GitHub Desktop.
Save iocanel/7c41003744b88830dd27 to your computer and use it in GitHub Desktop.
Understanding what runs where in Jenkins + Kubernetes
node {
def hostname = readFile '/etc/hostname'
echo "Local node hostname: $hostname"
}
node('kubernetes') {
def hostname = readFile '/etc/hostname'
echo "Kubernetes slave hostname: $hostname"
}
node('kubernetes') {
kubernetes.pod('mypod').withImage('maven').inside {
def hostname = readFile '/etc/hostname'
echo "Kubernetes slave in pod hostname: $hostname"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment