Skip to content

Instantly share code, notes, and snippets.

@parjun8840
Created March 23, 2023 01:38
Show Gist options
  • Save parjun8840/aa086836254bfcce13c849dea0e022d1 to your computer and use it in GitHub Desktop.
Save parjun8840/aa086836254bfcce13c849dea0e022d1 to your computer and use it in GitHub Desktop.
basic01- k8s pods list
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: kubectl-image
image: alpine/k8s:1.24.12
command:
- cat
tty: true
'''
}
}
stages {
stage('Check Pods') {
steps {
container('kubectl-image') {
sh 'kubectl get po -A'
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment