Reader small image

You're reading from  The KCNA Book

Product typeBook
Published inJun 2023
PublisherPackt
ISBN-139781835080399
Edition1st Edition
Right arrow
Author (1)
Nigel Poulton
Nigel Poulton
author image
Nigel Poulton

Nigel Poulton is a cloud-native subject matter expert who spends his life creating books and training videos on the latest cloud technologies. He is the author of best-selling books on Docker and Kubernetes and the most popular online training videos on the same topic. He is a Docker Captain. Prior to this, Nigel has held various infrastructure roles for large enterprises. When he is not playing with technology, he is dreaming about it. When he is not dreaming about it, he is reading and watching sci-fi. He wishes he lived in the future so he could explore spacetime, the universe, and tons of other mind-blowing stuff. He likes cars, football (soccer), and food. He has a fabulous wife and three children.
Read more about Nigel Poulton

Right arrow

Containers and pods

Let’s clear up some terminology before getting into the detail.

We sometimes use the terms container and pod to mean the same thing. However, a pod is actually a thin wrapper around one or more containers and is a mandatory requirement for any container that wants to run on Kubernetes. This means containers must be wrapped in a pod if they want to run on Kubernetes. The following extremely simple YAML file defines a pod with a single container.

1  apiVersion: v1
2  kind: Pod
3  metadata:
4    name: kcna-pod
5    labels:
6      project: kcna-book
7  spec:
8    containers:     <<==== Container is defined below here
9      - name: kcna-container
10       image: <container-image-goes-here>

Lines 1-7 give the pod and name and a label. Lines 8-10 show the container definition embedded within the overall pod definition. As the container is embedded within the pod definition, we say the pod “wraps the container”.

As well as...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The KCNA Book
Published in: Jun 2023Publisher: PacktISBN-13: 9781835080399

Author (1)

author image
Nigel Poulton

Nigel Poulton is a cloud-native subject matter expert who spends his life creating books and training videos on the latest cloud technologies. He is the author of best-selling books on Docker and Kubernetes and the most popular online training videos on the same topic. He is a Docker Captain. Prior to this, Nigel has held various infrastructure roles for large enterprises. When he is not playing with technology, he is dreaming about it. When he is not dreaming about it, he is reading and watching sci-fi. He wishes he lived in the future so he could explore spacetime, the universe, and tons of other mind-blowing stuff. He likes cars, football (soccer), and food. He has a fabulous wife and three children.
Read more about Nigel Poulton