apiVersion: batch/v1
kind: Job
metadata:
  name: manual-cleaner
spec:
  template:
    spec:
      containers:
        - name: cleaner
          image: ivukotic/vpservice:cleanup
          command: ["/usr/src/app/start.sh"]
          # command: ["sleep"]
          # args: ["99999999"]
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 1000m
              memory: 500Mi
          env:
            - name: RUCIO_ACCOUNT
              value: "ivukotic"
            - name: X509_USER_PROXY
              value: "/tmp/x509up_u0"
          volumeMounts:
            - name: certs-volume
              mountPath: "/etc/grid-certs/"
              readOnly: true
      restartPolicy: Never
      volumes:
        - name: certs-volume
          secret:
            secretName: cert-secret
            items:
              - key: userkey
                path: userkey.pem
                mode: 0400
              - key: usercert
                path: usercert.pem
