Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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