Skip to content

Kubernetes Basics

Glossary

124 terms from Kubernetes Basics, in plain words, each with the chapter that teaches it.

#

--from-file, --from-literal
Options of `kubectl create configmap` (and `create secret`): `--from-file` makes one key per file, and `--from-literal=KEY=VALUE` adds one value typed on the command line.

A

accessModes
A PersistentVolumeClaim setting that says how the volume may be mounted, for example by one node or by many.
Annotation
A note attached to an object, like a label, but meant for people and tools rather than selectors. Sam uses one to record why a Deployment changed.
API server
The control plane's front door. Every request from kubectl or from inside the cluster goes through it.
apiVersion
A manifest key naming the version of the Kubernetes API the object belongs to, such as `v1` for Pods and `apps/v1` for Deployments.

B

Back-off
Waiting longer between each retry. Kubernetes does this for a failing container so a broken app doesn't burn the node's CPU.
base64
A way of writing any data as plain letters and digits. Secrets are stored this way, which is an encoding anyone can reverse, not encryption.
busybox
A tiny container image that bundles basic Linux tools such as `sh`, `env` and `wget` in a very small size. It is handy for throwaway test pods that run a quick command, like printing environment variables.

C

Cluster
A group of machines that Kubernetes manages as one system.
ClusterIP
The default Service type. It gives the Service an address that works only inside the cluster.
Conditions
Entries in an object's `status` section, such as `Available`, each marked true or false.
ConfigMap
An object that stores settings or whole files as keys and values. Pods get them as files or environment variables, so Priya can change the price page without a new image.
configMapKeyRef
An `env` setting that copies one key of a ConfigMap into an environment variable.
Container runtime
The program on each node that actually runs containers. Kubernetes usually uses containerd.
containerd
The container runtime Kubernetes usually uses to run containers. It's the same runtime that sits inside Docker.
containerPort
A container setting recording the port the app listens on. It's information for people and tools and doesn't publish anything.
Context
A named entry in the kubeconfig that pairs a cluster with a user (and can set a default namespace). kubectl uses the current context to decide which cluster to talk to.
Control plane
The cluster's brain: the API server, etcd, scheduler and controller manager. It decides what runs where and watches over everything.
Controller
A loop that compares the desired state with the actual state and fixes any difference, for example starting a pod when one is missing.
Controller manager
The control plane part that runs Kubernetes' built-in controllers.
CoreDNS
The cluster's DNS service, run as pods in `kube-system`. It turns Service names into addresses.
CrashLoopBackOff
A pod status meaning the container keeps starting, failing and being restarted, with longer waits each time. Read `kubectl logs --previous` to find out why.
CreateContainerConfigError
A pod status meaning the pod refers to a ConfigMap, Secret or key that doesn't exist, so the container can't start.
curl
A command-line tool for making HTTP requests and downloading files from URLs. It is used to fetch installers and to send requests, such as posting orders to an app, from a terminal.

D

Declarative
Describing in files what should exist and applying them with `kubectl apply`, instead of issuing one-off commands.
Dependent variable
An environment variable whose value includes another variable defined earlier in the same container's `env` list, written `$(NAME)`. Kubernetes fills in the earlier value, so `SIGNATURE: "Sam, $(TEAM) team"` becomes `Sam, wholesale team`, and a database URL can be built from `$(DB_PASSWORD)`.
Deployment
An object that keeps a set number of identical pods running through a ReplicaSet and manages updates, such as the `kc-site` Deployment.
Desired state
What you asked for in your manifests, such as three copies of the price page. Kubernetes works to make the cluster match it.
DNS (cluster)
The in-cluster naming service that gives each Service a name such as `kc-site.default.svc.cluster.local`.
Dockerfile
A text file with the steps for building a container image, such as the one for the orders app.
Dry run
Running a command that checks or prints its result without changing the cluster. `client` only prints; `server` has the API server validate the file and then save nothing.
Dynamic provisioning
Automatic creation of a PersistentVolume by a StorageClass when a claim asks for storage.

E

emptyDir
A volume that starts empty with the pod and is deleted with it. It survives container restarts and can be shared by the pod's containers.
Endpoints
The up-to-date list of ready pod addresses behind a Service. If the list is empty, the Service's selector matches no ready pods.
env
A container setting that defines environment variables one by one, with a literal `value` or a `valueFrom` reference.
envFrom
A container setting that turns every key of a ConfigMap or Secret into an environment variable of the same name.
Environment variable
A named setting a program reads from its surroundings, such as `DATABASE_URL` for the orders app.
ErrImagePull, ImagePullBackOff
Pod statuses meaning the image can't be downloaded, often because of a wrong image name or tag.
etcd
The cluster's database, which stores the desired and current state of every object.
Events
Short records of what happened to an object, such as Scheduled, Pulled or probe failures. `kubectl describe` shows them at the bottom.
exec probe
A probe type that runs a command inside the container; exit code 0 passes and anything else fails. The database uses `pg_isready` this way.
extraPortMappings
A kind setting that publishes a node container's ports on your computer, like `-p` in `docker run`. It can't be changed after the cluster is created.

F

Flask
A small Python web framework. The orders app is a Flask app with routes for listing and adding orders.

G

Gi (gibibyte)
A storage size unit: `1Gi` is 1,073,741,824 bytes. It's what the database's PVC requests.
Gunicorn
A production web server for Python apps. The orders app image starts it on port 8000 with two workers.

H

Helm
A package manager for Kubernetes apps, mentioned as a topic for the next book.
HorizontalPodAutoscaler
A Kubernetes object that automatically raises or lowers the number of pod replicas of a workload such as a Deployment as load changes, for example when CPU use goes up or down.
httpGet
A probe type that requests a page from the container. A status from 200 to 399 passes.

I

imagePullPolicy
A setting for when the kubelet pulls an image: `IfNotPresent`, `Always` or `Never`. Fixed tags default to `IfNotPresent`, while `latest` defaults to `Always`.
Imperative
Commands that change the cluster straight away, such as `kubectl run` or `kubectl scale`, rather than describing a file.
Ingress
A Kubernetes object that routes many websites through one address by host name. It's covered in the next book.

K

kind
A tool that runs a Kubernetes cluster on your own computer, with each node running as a Docker container (the name stands for Kubernetes IN Docker). It is used to create quick, disposable practice clusters that leave nothing behind when deleted.
kind (manifest key)
The manifest key that gives the type of object, such as Pod, Deployment or Service.
kind load docker-image
A command that copies an image from your local Docker into every node of a kind cluster, since the nodes can't see your Docker's images.
kubeconfig
The file `~/.kube/config` that holds the clusters, users and contexts kubectl can connect to.
kubectl
Kubernetes' command-line tool, which sends your requests to the API server.
kubectl annotate
A command that sets an annotation on an object, such as the change-cause on a Deployment's revision.
kubectl apply
A command that sends a manifest to the API server, creating the object or updating it to match the file.
kubectl delete
A command that deletes objects by name or from a file. Deleting a namespace deletes everything inside it.
kubectl describe
A command that shows an object's details and, at the bottom, its Events. It's the usual way to find out why a pod is stuck.
kubectl exec
A command that runs a program inside a running container, like `docker exec`. Everything after `--` is the command.
kubectl explain
A command that prints the documentation of a manifest field, taken from the API server so it matches your cluster's version.
kubectl get
A command that lists objects as a table. Options like `-o wide`, `-o yaml`, `-l`, `-A` and `-w` change what it shows.
kubectl logs
A command that prints what a container wrote to its output. `--previous` shows the last crashed run, `-f` follows, `--tail` limits lines and `--prefix` labels lines with the pod name.
kubectl rollout
A group of commands to follow a Deployment's rollout, list its revisions, go back to an earlier one, or restart all its pods.
kubectl run
An imperative command that starts a pod straight away. With `--dry-run=client -o yaml` it prints a starting manifest.
kubectl scale
A command that changes a Deployment's replica count immediately, without updating your file.
kubectl set image
A command that changes a Deployment's container image and starts a rolling update, leaving your file out of date.
kubelet
The agent on each node. It receives work from the API server, starts containers, runs probes and reports on health.
Kubernetes
An open-source system, first built at Google, that runs containers across a group of machines and keeps them running.
kubernetes-validate
A tool that checks manifests against Kubernetes' own schema without needing a cluster.
Kustomize
A tool built into kubectl that adapts one set of files to several environments.

L

Labels
Key-value tags you put on objects, such as `app: kc-site`. Selectors use them to find objects.
livenessProbe
A check that restarts a container after repeated failures. It rescues an app that's alive but stuck, and shouldn't depend on other services.
LoadBalancer
A Service type where a cloud provider creates a load balancer with a public address. On kind it stays pending.

M

Managed cluster
A cluster whose control plane a cloud provider runs for you, such as Amazon EKS, Google GKE or Azure AKS.
Manifest
A YAML file describing one or more objects, sent to the API server.
matchLabels
The part of a Deployment's selector that lists labels a pod must have to belong to the Deployment.
maxSurge, maxUnavailable
Rolling-update settings: how many extra pods above `replicas` may exist, and how many may be not ready, during an update.
minikube
Another popular tool for running a small Kubernetes cluster locally.

N

Namespace
A named section of a cluster that keeps objects apart. Kubernetes' own parts live in `kube-system` and yours go in `default` unless you choose another.
Node
One machine in the cluster: a physical server, a cloud virtual machine or, in kind, a container.
NodePort
A Service type that also opens a port from 30000 to 32767 on every node, so you can reach the app from outside the cluster.
nslookup
A command that asks DNS for the address behind a name. It's used to test whether a Service name resolves.

O

Object
A record of desired state stored in the cluster, such as a Pod, Deployment or Service. Each has a kind.
OOMKilled
A container status meaning it used more memory than its limit and was stopped.

P

Pending
A pod status meaning no node has been picked yet, because none has room or a PVC the pod needs isn't Bound. Check Events and `kubectl get pvc`.
PersistentVolume (PV)
A piece of real storage in the cluster, such as a cloud disk or a folder on a kind node.
PersistentVolumeClaim (PVC)
A request for storage, such as 1Gi to read and write, that a pod mounts. Deleting the claim can delete the data.
pg_isready
A Postgres command that reports whether the database accepts connections. It's used as the database's readiness probe.
Pod
The smallest thing Kubernetes runs: one or more containers sharing a network address and optionally files. Pods are disposable.
pod-template-hash
A label a ReplicaSet adds to its pods so they can be told apart from the pods of other ReplicaSets. The hash also appears in the ReplicaSet and pod names.
port-forward
A kubectl command that connects a port on your computer to a pod or Service, so you can open it in a browser.
Postgres
The open-source database used for the orders app.
Probe
A check the kubelet runs on a container again and again. What happens on failure depends on the probe type.
Probe timing settings
Settings that control a probe: `periodSeconds` is how often it runs, `initialDelaySeconds` the wait before the first check, `timeoutSeconds` how slow an answer may be, and `failureThreshold` how many fails in a row count as failing.
psql
Postgres's command-line client, run inside the database pod to run queries.
psycopg
The Python driver the orders app uses to talk to Postgres.

R

readinessProbe
A check that keeps a pod out of its Service's endpoints until it passes. The container keeps running meanwhile.
ReadWriteOnce
An access mode meaning the volume can be mounted read-write by one node at a time.
Reclaim policy
What happens to a PersistentVolume when its claim is deleted. kind's default class uses `Delete`, so the data goes too.
Reconciliation
Controllers repeatedly comparing actual state with desired state and fixing any difference.
Recreate
A Deployment update strategy that stops all old pods before starting new ones, which causes downtime. The database uses it so two Postgres servers never share one disk.
Replicas
The number of identical pods a Deployment keeps running.
ReplicaSet
The object a Deployment creates to keep a set number of identical pods of one version running.
restartPolicy
A pod setting for whether containers are restarted when they end. The default is `Always`; `Never` makes a run-once pod.
Revision
A numbered version of a Deployment's pod template, listed by `kubectl rollout history`.
Rolling update
Replacing pods a few at a time so the app stays up. A new ReplicaSet grows while the old one shrinks, and each new pod must pass its readiness probe first.

S

Scheduler
The control plane part that picks a node for each new pod, based on which nodes have room.
Secret
An object like a ConfigMap but meant for passwords, keys and tokens. Its values are only base64-encoded, so keep its YAML out of Git.
secretKeyRef
An `env` setting that copies one key of a Secret into an environment variable.
Selector
A label query that picks objects, such as the pods belonging to a Deployment or Service.
Service
An object giving a changing set of pods one steady name and address, chosen by a selector. It's not the same as a Compose service.
startupProbe
A check that holds the other probes back until a slow app has started.
StatefulSet
A Kubernetes object for databases with several replicas, covered in the next book.
StorageClass
A description of a kind of storage that creates PersistentVolumes on demand when a claim asks. kind's default is `standard`.

T

targetPort
The Service setting for the port on the pods that requests are sent to. `port` is the Service's own port.
tcpSocket
A probe type that passes if a connection to a port opens.
Template
The pod description inside a Deployment, used as the pattern for each new pod. A change to it starts a rolling update.
Throwaway pod
A short-lived pod started with `kubectl run --rm -it --restart=Never` to run one command, such as `wget` or `nslookup`, from inside the cluster. It's deleted when the command ends.

V

Volume
A folder pod containers can use, defined under the pod's `volumes` and placed in a container with `volumeMounts` at a `mountPath`.

W

Worker node
A node that runs your containers, as opposed to the control plane.

Y

YAML
A text format of keys and values using two-space indents and `- ` for list items. Manifests are written in it, and tabs are not allowed.
yamllint
A tool that finds mistakes in YAML files, such as tabs used for indenting.