KubeCon EU 2016: Getting the Jobs Done With Kubernetes

20
Getting the Jobs Done With Kubernetes / OpenShift Maciej Szulik, KubeCon 2016 1 / 20

Transcript of KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Page 1: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Getting the Jobs Done With

Kubernetes / OpenShift

Maciej Szulik, KubeCon 2016

1 / 20

Page 2: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

soltysh @

[email protected]

https://github.com/soltysh/talks/

2 / 20

Page 3: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

3 / 20

Page 4: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

4 / 20

Page 5: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job apiVersion: batch/v1kind: Jobmetadata: name: hellospec: template: metadata: name: hello spec: containers: - name: hello image: python:3.5.1 command: ["python", "-c", "print('Hello world!')"] restartPolicy: Never

5 / 20

Page 6: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

-> apiVersion: batch/v1

kind: Jobmetadata: name: jobspec: template: metadata: name: job spec: containers: - name: job image: python:3.5.1 command: ["python", "-c", "print('Hello world!')"] restartPolicy: Never

6 / 20

Page 7: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

apiVersion: batch/v1kind: Jobmetadata: name: jobspec: template: metadata: name: job spec: containers:

-> - name: job image: python:3.5.1 command: ["python", "-c", "print('Hello world!')"]

restartPolicy: Never

7 / 20

Page 8: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

apiVersion: batch/v1kind: Jobmetadata: name: jobspec: template: metadata: name: job spec: containers: - name: job image: python:3.5.1 command: ["python", "-c", "print('Hello world!')"]

-> restartPolicy: Never

8 / 20

Page 9: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

Always

OnFailure

Never

9 / 20

Page 10: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

Always

OnFailure

Never

10 / 20

Page 11: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

- pod selector?

apiVersion: batch/v1kind: Jobmetadata: name: jobspec: template: metadata: name: job spec: containers: - name: job image: python:3.5.1 command: ["python", "-c", "print('Hello world!')"] restartPolicy: Never

11 / 20

Page 12: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

- pod selector?

- parallelism /completions

single jobs.spec.completions: 1.spec.parallelism: 1

12 / 20

Page 13: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

- pod selector?

- parallelism /completions

single jobs.spec.completions: 1.spec.parallelism: 1

parallel job with a fixed completions count.spec.completions: 8.spec.parallelism: 4

13 / 20

Page 14: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Job

- api

- command

- restart policy

- pod selector?

- parallelism /completions

single jobs.spec.completions: 1.spec.parallelism: 1

parallel job with a fixed completions count.spec.completions: 8.spec.parallelism: 4

parallel job with a work queue.spec.completions: <unset>

.spec.parallelism: 4

14 / 20

Page 15: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Use Cases- data calculations

- image rendering

etc.

15 / 20

Page 16: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Rendering

16 / 20

Page 17: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Render demo

17 / 20

Page 19: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

http://commons.openshift.org/join

19 / 20

Page 20: KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Links

soltysh @

[email protected]

http://releases.k8s.io/master/docs/proposals/job.md

http://releases.k8s.io/master/docs/user-guide/jobs.md

20 / 20