KubeCon EU 2016: Getting the Jobs Done With Kubernetes

Post on 15-Apr-2017

498 views 2 download

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

Getting the Jobs Done With

Kubernetes / OpenShift

Maciej Szulik, KubeCon 2016

1 / 20

soltysh @

maszulik@redhat.com

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

2 / 20

3 / 20

Job

4 / 20

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

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

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

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

Job

- api

- command

- restart policy

Always

OnFailure

Never

9 / 20

Job

- api

- command

- restart policy

Always

OnFailure

Never

10 / 20

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

Job

- api

- command

- restart policy

- pod selector?

- parallelism /completions

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

12 / 20

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

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

Use Cases- data calculations

- image rendering

etc.

15 / 20

Rendering

16 / 20

Render demo

17 / 20

http://commons.openshift.org/join

19 / 20

Links

soltysh @

maszulik@redhat.com

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

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

20 / 20