apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins-deploy
spec:
  selector:
    matchLabels:
      app: jenkins-deploy
  template:
    metadata:
      labels:
        app: jenkins-deploy
    spec:
      containers:
      - name: jenkins-deployjenkins-deploy
        image: jenkins
        imagePullPolicy: Never
        securityContext:
          privileged: true
        resources:
          limits:
            memory: "2Gi"
            cpu: "2000m"
        ports:
        - containerPort: 8080
        volumeMounts:
          - mountPath: /var/jenkins_home
            name: jenkins-volume
          - name: dockersock
            mountPath: "/var/run/docker.sock"
          - name: github-ssh
            mountPath: /var/gitssh
            readOnly: true
      volumes:
        - name: jenkins-volume
          persistentVolumeClaim:
            claimName: jenkins-pvc
        - name: dockersock
          hostPath:
            path: /var/run/docker.sock
        - name: github-ssh
          secret:
            defaultMode: 420
            secretName: gitssh
