apiVersion: batch/v1
kind: Job
metadata:
  name: create-web-key
spec:
  activeDeadlineSeconds: 100
  template:
    metadata:
      name: credential-mgmt
    spec:
      containers:
      - name: credential-mgmt
        image: gcr.io/trust-networks/credential-mgmt:0.4
        command: ["./create-web-key",  "mark.adams@trustnetworks.com", "Mark Adams (TN)"]
        volumeMounts:
        - mountPath: /key
          name: keys
          readOnly: True
        - mountPath: /web_ca_cert
          name: web-ca-creds
          readOnly: True
        - mountPath: /web_ca
          name: web-ca-data
        env:
        - name: CA
          value: /web_ca
        - name: CA_CERT
          value: /web_ca_cert
      restartPolicy: Never
      volumes:
      - name: keys
        secret:
          secretName: keys
      - name: web-ca-creds
        secret:
          secretName: web-ca-creds
      - name: web-ca-data
        gcePersistentDisk:
          pdName: ca-0000
          fsType: ext4
