kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch08/pi/pi-job-random.yaml

31 lines
720 B
YAML
Raw Normal View History

apiVersion: batch/v1
kind: Job
metadata:
name: pi-job-random
labels:
kiamol: ch08
spec:
completions: 3
parallelism: 3
template:
spec:
initContainers:
- name: init-dp
image: kiamol/ch03-sleep
command: ['sh', '-c', 'echo $RANDOM > /init/dp']
volumeMounts:
- name: init
mountPath: /init
containers:
- name: pi
image: kiamol/ch05-pi
command: ['sh', '-c', 'dotnet Pi.Web.dll -m console -dp $(cat /init/dp)']
volumeMounts:
- name: init
mountPath: /init
readOnly: true
restartPolicy: Never
volumes:
- name: init
emptyDir: {}