I am looking to retain PVC when the jenkins job is completed.
podTemplate(workspaceVolume: dynamicPVC(requestsSize: "1Gi",storageClassName: 'test'), containers: [
containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:3.35-5-alpine', args: '${computer.jnlpmac} ${computer.name}')
], yaml:'''
spec:
securityContext:
fsGroup: 1000
''') {
node(POD_LABEL) {
container(name: 'jnlp') {
sh 'echo .....'
}
}
}
and My test storage class definition
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: test
provisioner: kubernetes.io/gce-pd
reclaimPolicy: Retain
parameters:
type: pd-ssd
Everything works fine. But PVC is deleted when job is completed. Is there any way to retain the pVC.