Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55904

Kubernetes pod template with persistance volume

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • K8s

      Hi,

      we are using jenkins on k8s and running slave on pods using pod template.we want to use DSL language for jenkins and trying to do with volume option with agent on k8s. like below example

       

      pipeline {
        agent {
              kubernetes {
                  label 'jenkins-demo'
                      containerTemplate {
                          name 'dind-jdk8-maven3'
                          image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
                          ttyEnabled true
                          command 'cat'
                      }
                       
                  }
              volumes {
                            type persistentVolumeClaim
                            mountPath '/home/jenkins/workspace'
                            claimName 'jenkins-workspace-pv'
                            readOnly false
                      }     
        }   
        -----
      -------
      }
      

      Is there any possibility to like this or we can just do it with another approach.
      If we want to write in another format please post an example for this .

            csanchez Carlos Sanchez
            venkatkriish venkatesh kristipati
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: