apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-jenkins
spec:
  replicas: 1
  selector:
    matchLabels:
      run: my-jenkins
  template:
    metadata:
      labels:
        run: my-jenkins
    spec:
      volumes:
        - name: jenkins-storage
          persistentVolumeClaim:
            claimName: jenkins-pvc-dynamic
      containers:
      - image: jenkins
        name: my-jenkins
        ports:
        - containerPort: 8080
        - containerPort: 50000
        volumeMounts:
        - mountPath: "/var/jenkins_home"
          name: jenkins-storage