Recently I have been trying to setup a pipeline inside jenkins. The aim is to create a pod and perform kubernetes deployment.
But when i run the pipeline job it keeps on creating pods one after another, it never completes the job -
pipeline {
agent {
kubernetes {
//cloud 'kubernetes'
yaml """
kind: Pod
metadata:
name: kaniko
spec:
containers:
- name: jhooq-pod-with-pvc
image: rahulwagh17/kubernetes:jhooq-k8s-springboot
imagePullPolicy: Always
"""
}
}
stages {
stage('build') {
steps {
echo "Hello World!"
}
}
}
}
Not - Pods are getting created successfully and kubernetes deployment is also successful but the jenins pipeline never stops.
And my jenkins in connected to kubernetes without any issues.
Any suggestions or input will be highly appreciated.