apiVersion: batch/v1
kind: Job
metadata:
  labels:
    chart: '{{.Chart.Name}}-{{.Chart.Version}}'
    heritage: '{{.Release.Service}}'
    job-name: pi
    release: '{{.Release.Name}}'
  name: '{{ template "fullname" . }}-pi'
  namespace: '{{.Values.pi.namespace}}'
spec:
  completions: 1
  parallelism: 1
  template:
    metadata:
      labels:
        job-name: pi
      name: pi
    spec:
      containers:
      - command:
        - perl
        - -Mbignum=bpi
        - -wle
        - print bpi(2000)
        image: '{{.Values.pi.pi.image}}:{{.Values.pi.pi.imageTag}}'
        imagePullPolicy: '{{.Values.pi.pi.imagePullPolicy}}'
        name: pi
      restartPolicy: '{{.Values.pi.restartPolicy}}'
