apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins-master
spec:
  replicas: 1
  selector:
      matchLabels:
        app: jenkins-master
  template:
    metadata:
      labels:
        app: jenkins-master
    spec:
      containers:
       - name: jenkins-leader
         image: thirupathip/jenkins-master
         env:
            - name: JAVA_OPTS
              value: -Djenkins.install.runSetupWizard=false
         volumeMounts:
          - name: jenkins-home
            mountPath: /var/jenkins_home
          - name: docker-sock-volume
            mountPath: /var/run/docker.sock
          - name: kubectl-volume
            mountPath: /usr/bin/kubectl
          - name: ansible-volume
            mountPath: /usr/local/bin/ansible
          - name: helm-volume
            mountPath: /usr/local/bin/helm 
         ports:
           - name: http-port
             containerPort: 8080
           - name: jnlp-port
             containerPort: 50000
      volumes:
       - name: jenkins-home
         persistentVolumeClaim:
           claimName: jenkins-pv-claim
       - name: docker-sock-volume
         hostPath:
           path: /var/run/docker.sock
       - name: kubectl-volume
         hostPath:
           path: /usr/bin/kubectl
       - name: ansible-volume
         hostPath:
           path: /usr/bin/ansible
       - name: helm-volume
         hostPath:
           path: /usr/local/bin/helm