Skip to content

Instantly share code, notes, and snippets.

@car-roll
Created August 23, 2019 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save car-roll/4471dc9231abeb1db1271ad349706bcb to your computer and use it in GitHub Desktop.
Save car-roll/4471dc9231abeb1db1271ad349706bcb to your computer and use it in GitHub Desktop.
pipeline {
agent any
stages {
stage('Standard') {
agent {
kubernetes {
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
some-label: some-label-value
"""
}
}
steps {
sh 'echo hello'
sleep 3
sh 'ps -e -o pid,ppid,stat,cmd'
}
}
stage('Shared Namespace') {
agent {
kubernetes {
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
some-label: some-label-value
spec:
shareProcessNamespace: true
"""
}
}
steps {
sh 'echo hello'
sleep 3
sh 'ps -e -o pid,ppid,stat,cmd'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment