Skip to main content

Terminal, Git, and YAML essentials

You will be able to: read any command in the walkthroughs before running it, and read a manifest in four passes.

Shell​

SyntaxMeaning
cmd --flag valueOption with value
a | bPipe a's output into b
a && bRun b only if a succeeded
> fileOverwrite file (destructive)
<name>Placeholder. Replace it, brackets included
Ctrl+CStop a foreground watch or port-forward
  • pwd shows where you are; relative paths start there.
  • Check cluster, namespace and directory before any command that changes things.

Git (only these)​

git status --short # empty = clean
git rev-parse HEAD # exact commit
  • Use a dedicated clone. Pinned commit: see setup.

YAML​

  • Indentation = nesting. Spaces only, never tabs.
  • key: value is a mapping. - item is a list entry.
apiVersion: v1 # 1. what type
kind: Pod
metadata: # 2. name, namespace, labels
name: booking
labels:
app: booking
spec: # 3. desired state
containers: # list
- name: booking
image: example/booking:1.0
ports:
- containerPort: 8082

Four passes over any manifest:

  1. apiVersion + kind: which object?
  2. metadata: name, namespace, labels.
  3. spec: desired state.
  4. References: which names and labels must match exactly (selectors, secretKeyRef, serviceName)?

Gotchas​

  • Key order does not mean execution order.
  • A valid manifest can still point at a missing name.
  • kubectl apply succeeding means the API accepted it. Nothing more.

Check yourself​

containers: is followed by two lines starting - name:. What is that?

A list of two container definitions.

Does a successful kubectl apply prove the app works?

No. Only that the API accepted the object. Controllers, scheduling and the request path still need checking.

Next: Meet Apollo Airlines.