Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Kubernetes on AWS
  • Table Of Contents Toc
  • Feedback & Rating feedback
Kubernetes on AWS

Kubernetes on AWS

By : Ed Robinson
1 (3)
close
close
Kubernetes on AWS

Kubernetes on AWS

1 (3)
By: Ed Robinson

Overview of this book

Docker containers promise to radicalize the way developers and operations build, deploy, and manage applications running on the cloud. Kubernetes provides the orchestration tools you need to realize that promise in production. Kubernetes on AWS guides you in deploying a production-ready Kubernetes cluster on the AWS platform. You will then discover how to utilize the power of Kubernetes, which is one of the fastest growing platforms for production-based container orchestration, to manage and update your applications. Kubernetes is becoming the go-to choice for production-grade deployments of cloud-native applications. This book covers Kubernetes from first principles. You will start by learning about Kubernetes' powerful abstractions - Pods and Services - that make managing container deployments easy. This will be followed by a guided tour through setting up a production-ready Kubernetes cluster on AWS, while learning the techniques you need to successfully deploy and manage your own applications. By the end of the book, you will have gained plenty of hands-on experience with Kubernetes on Amazon Web Services. You will also have picked up some tips on deploying and managing applications, keeping your cluster and applications secure, and ensuring that your whole system is reliable and resilient to failure.
Table of Contents (12 chapters)
close
close

CronJob

Now you have learned how to run one-off or batch tasks with jobs, it is simple to extend the concept in order to run scheduled jobs. In Kubernetes, a CronJob is a controller that creates new jobs from a template on a given schedule.

Let's begin with a simple example. The following example will launch a job every minute. This job will output the current date and time and then exit:

fun-with-cron.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: fun-with-cron
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
metadata:
labels:
cronjob: fun-with-cron
spec:
restartPolicy: OnFailure
containers:
- name: how-soon-is-now
image: alpine:3.6
command: ["/bin/date"]

Push the CronJob to Kubernetes with kubectl:

$ kubectl apply -f fun-with-cron.yaml

After...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY