Bitpath

Lesson 2 · Unit 01

Pods and manifests

The four parts of a manifest, what a Pod shares, and three commands to read one.

12 exercisesabout 3 min

What you practise

  • A manifest's four parts (apiVersion, kind, metadata, spec), containers in a pod, kubectl get, describe and logs

Try a question from this lesson

Pick one

This file asks the cluster to run one container. Which top-level part says what you want, as opposed to what kind of thing it is or what it is called?

YAML
apiVersion: v1
kind: Pod
metadata:
  name: web
  labels:
    app: web
spec:
  containers:
    - name: web
      image: shop/web:1.4
      ports:
        - containerPort: 80
Hint

Three of the parts identify the object. Find the one that describes containers.

The ideas

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Four parts in every manifest

A manifest is a file describing one object. It always has the same four parts.

apiVersion and kind: which type of object, and which version of its schema. metadata: its name and labels. spec: the state you want.

A Pod is the smallest thing Kubernetes runs: one or more containers started together on one node. Once it exists, the cluster adds a fifth part, status, recording what is actually true. You write spec. The cluster writes status.

Concept

What the containers in a Pod share

Most Pods hold one container. A Pod holds more when they must live and die together, such as an app and a helper that ships its logs.

Containers in one Pod share a network identity: the Pod has one IP address, and its containers reach each other on localhost. They can also share files through a volume.

In Docker each container had its own network identity. Here the Pod has it.

Pod web             IP 10.244.1.7
+-------------------------------+
|  app :8080      log-shipper   |
|         localhost             |
+-------------------------------+

9 more exercises in the app

  • 1× fill the blanks
  • 2× true or false
  • 3× multiple choice
  • 1× match the pairs
  • 1× type the answer
  • 1× order the lines

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy