apiVersion: v1
kind: Pod
metadata:
  name: linecount-pod
spec:
  restartPolicy: OnFailure
  volumes:
  - name: git-repo
    emptyDir: {}

  containers:
  - name: stats
    image: mribeiro/cloc
    args: ['/git']
    volumeMounts:
    - name: git-repo
      mountPath: /git

  initContainers:
  - name: git-clone
    image: emblica/git-cloner
    volumeMounts:
    - name: git-repo
      mountPath: /mnt/git
    env:
    - name: REPOSITORY_URL
      value: 'git@github.com:emblica/git-cloner.git'
    - name: SSH_PRIVATE_KEY
      valueFrom:
        secretKeyRef:
          name: git-repo
          key: deploy-key
