DEV Community

Moon
Moon

Posted on

Kubernetes for Beginners: Understanding Jobs, Images, and More (Part 1)

**
What is Kubernetes?**

Let's imagine an office. In this office, there's an arrogant boss with hundreds or even thousands of messy workers. The boss takes care of everything, making sure the workers are doing their jobs properly, not fighting with each other, and fixing any messes they make. Now, the boss is our cute Kubernetes, and the workers are Docker containers.

Kubernetes Images - The Recipe Book 🍰
Now, let's say you want to bake a cake. To bake a cake, you need a recipe book, right? This recipe book is like Kubernetes images. We use these images to create containers (which are like the cakes). Every time we want to run the app, Kubernetes uses the image (the recipe) to build it.

Kubernetes Jobs - Different Types of Tasks
Now, what are Kubernetes Jobs? Well, let's break it down!
1. Simple Job (One-time Task)
Imagine your mom asks you to clean your room just once. Once you clean your room, you're done! In Kubernetes, a Job runs a task in the background, and once the task is complete, the Job is finished.
2. Parallel Job (Doing Multiple Tasks at Once)
Now, imagine you and three of your friends are all asked to pick up toys in different corners of the room at the same time. You're all working together, and once everyone's done, the task is complete. A Parallel Job is when you need to do multiple tasks at the same time.
3. CronJob (Scheduled Task)
Every day, you go to school or work at the same time, right? Can you go two hours early or two hours late? No, because it's scheduled. In Kubernetes, a CronJob is used to schedule jobs that need to happen at a specific time.

Recap:
Simple Job: One-time task, like cleaning your room.
Parallel Job: Doing several tasks at once, like you and your friends cleaning different parts of the room together.
CronJob: Scheduled tasks, like going to school or work at the same time every day.

What's Next? Part 2 is coming soon.

Top comments (0)