Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cloud Native with Kubernetes

You're reading from   Cloud Native with Kubernetes Deploy, configure, and run modern cloud native applications on Kubernetes

Arrow left icon
Product type Paperback
Published in Jan 2021
Publisher Packt
ISBN-13 9781838823078
Length 446 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Alexander Raul Alexander Raul
Author Profile Icon Alexander Raul
Alexander Raul
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Section 1: Setting Up Kubernetes
2. Chapter 1: Communicating with Kubernetes FREE CHAPTER 3. Chapter 2: Setting Up Your Kubernetes Cluster 4. Chapter 3: Running Application Containers on Kubernetes 5. Section 2: Configuring and Deploying Applications on Kubernetes
6. Chapter 4: Scaling and Deploying Your Application 7. Chapter 5: Services and Ingress – Communicating with the Outside World 8. Chapter 6: Kubernetes Application Configuration 9. Chapter 7: Storage on Kubernetes 10. Chapter 8: Pod Placement Controls 11. Section 3: Running Kubernetes in Production
12. Chapter 9: Observability on Kubernetes 13. Chapter 10: Troubleshooting Kubernetes 14. Chapter 11: Template Code Generation and CI/CD on Kubernetes 15. Chapter 12: Kubernetes Security and Compliance 16. Section 4: Extending Kubernetes
17. Chapter 13: Extending Kubernetes with CRDs 18. Chapter 14: Service Meshes and Serverless 19. Chapter 15: Stateful Workloads on Kubernetes 20. Assessments 21. Other Books You May Enjoy

Using Jobs

The purpose of the Job resource in Kubernetes is to run tasks that can complete, which makes them not ideal for long-running applications, but great for batch jobs or similar tasks that can benefit from parallelism.

Here's what a Job spec YAML looks like:

job-1.yaml

apiVersion: batch/v1
kind: Job
metadata:
  name: runner
spec:
  template:
    spec:
      containers:
      - name: run-job
        image: node:lts-jessie
        command: ["node", "job.js"]
      restartPolicy: Never
  backoffLimit: 4

This Job will start a single Pod, and run a command, node job.js, until it completes, at which point the Pod will shut down. In this and the future examples, we assume that the container image used has a file, job.js, that runs...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image