apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    spec:
      hostNetwork: true
      hostIPC: true
      hostPID: true
      hostAliases:
        - ip: "127.0.0.1"
          hostnames:
            - "foo.local"
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
        ports:
          - containerPort: 22
          - containerPort: 80
          - containerPort: 443
        securityContext:
          capabilities:
              add:
                - CAP_SYS_ADMIN
          readOnlyRootFilesystem: false
          runAsNonRoot: false
          runAsUser: 10
          seLinuxOptions:
              level: "s0:c123,c456"
          privileged: true
          allowPrivilegeEscalation: true
        volumeMounts:
          - name: varlog
            mountPath: /var/log
            mountPropagation: Bidirectional
      restartPolicy: Never
      volumes:
        - name: dev
          hostPath:
            path: /dev/
        - name: dockersock
          hostPath:
            path: /var/run/docker.sock
  backoffLimit: 4
