apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jenkins
  template:
    metadata:
      labels:
        app: jenkins
    spec:
      containers:
      - name: jenkins
        image: mysticrenji/jenkins-lts:latest
        env:
          - name: JAVA_OPTS
            value: -Djenkins.install.runSetupWizard=false
        ports:
          - name: http-port
            containerPort: 8080
          - name: jnlp-port
            containerPort: 50000
        volumeMounts:
          - name: jenkins-vol
            mountPath: /var/jenkins_vol
      volumes:
        - name: jenkins-vol
          persistentVolumeClaim:
            claimName: jenkins-volume-claim
          #hostPath:
          #  path: /home/ubuntu/jenkins/data
          #  type: Directory
