teluzia.Cloud Engineer · Day 113
CHAPTER 17 · KUBERNETES FUNDAMENTALS

Cluster objects, pods and kubectl

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Kubernetes is a desired-state supervisor: object specifications are requests, controllers reconcile them, and kubectl inspects the results. The control plane exposes the Kubernetes API and stores cluster state. Nodes run workloads. Objects have metadata, a desired spec, and observed status where applicable. Namespaces scope many resource names and permissions, but not every object is namespaced. API acceptance does not guarantee successful scheduling. A Pod is the smallest deployable scheduling unit and can contain cooperating containers sharing network and selected volumes. Containers in one Pod share the Pod’s network namespace. Pods are replaceable and are not intended as permanent identities for durable business data.

Think of it this way

Kubernetes is a desired-state supervisor: object specifications are requests, controllers reconcile them, and kubectl inspects the results.

TOPIC 01 / 03Step by step

Cluster API and objects

The control plane exposes the Kubernetes API and stores cluster state. Nodes run workloads. Objects have metadata, a desired spec, and observed status where applicable. Namespaces scope many resource names and permissions, but not every object is namespaced. API acceptance does not guarantee successful scheduling. For example, a Pod spec requests a container image; status later reports Pending, Running, or other observed conditions.

WORKED EXAMPLE
A Pod spec requests a container image; status later reports Pending, Running, or other observed conditions.

A manifest requests a Pod through the Kubernetes API. The API checks the request and stores the accepted object. Controllers and the scheduler then act on desired state, and node components try to start the container. The object's observed status changes as those operations proceed. Accepted configuration is therefore earlier than scheduled, running, and ready application behavior.

The control plane coordinates cluster state. Spec describes desired configuration. Status reports observed conditions where applicable. Nodes supply execution capacity. Namespaces scope many objects, while cluster-scoped resources have different naming and access behavior. A Pending Pod might be waiting for capacity, scheduling constraints, or another prerequisite; changing its YAML repeatedly without reading events obscures the cause. Follow the reconciliation sequence and inspect each boundary. Kubernetes automates management but cannot infer the correct business requirements from an image name or make missing credentials and unavailable dependencies disappear.

Why this matters

A Pod spec requests a container image; status later reports Pending, Running, or other observed conditions.

A common trap

Do not overlook this operational distinction: API acceptance does not guarantee successful scheduling.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Cluster API and objects

The control plane exposes the Kubernetes API and stores cluster state. Nodes run workloads. Objects have metadata, a desired spec, and observed status where applicable. Namespaces scope many resource names and permissions, but not every object is namespaced. API acceptance does not guarantee successful scheduling. For example, a Pod spec requests a container image; status later reports Pending, Running, or other observed conditions.

WORKED EXAMPLE
A Pod spec requests a container image; status later reports Pending, Running, or other observed conditions.

A manifest requests a Pod through the Kubernetes API. The API checks the request and stores the accepted object. Controllers and the scheduler then act on desired state, and node components try to start the container. The object's observed status changes as those operations proceed. Accepted configuration is therefore earlier than scheduled, running, and ready application behavior.

The control plane coordinates cluster state. Spec describes desired configuration. Status reports observed conditions where applicable. Nodes supply execution capacity. Namespaces scope many objects, while cluster-scoped resources have different naming and access behavior. A Pending Pod might be waiting for capacity, scheduling constraints, or another prerequisite; changing its YAML repeatedly without reading events obscures the cause. Follow the reconciliation sequence and inspect each boundary. Kubernetes automates management but cannot infer the correct business requirements from an image name or make missing credentials and unavailable dependencies disappear.

Why this matters

A Pod spec requests a container image; status later reports Pending, Running, or other observed conditions.

A common trap

Do not overlook this operational distinction: API acceptance does not guarantee successful scheduling.

Pods and container lifecycle

A Pod is the smallest deployable scheduling unit and can contain cooperating containers sharing network and selected volumes. Containers in one Pod share the Pod’s network namespace. Pods are replaceable and are not intended as permanent identities for durable business data. For example, two containers in one Pod can communicate via localhost, while two separate Pods normally require another reachable address.

WORKED EXAMPLE
Two containers in one Pod can communicate via localhost, while two separate Pods normally require another reachable address.

A Pod contains an application and a helper container. They are scheduled together and share the Pod's network namespace, so the helper can contact the application over localhost on its listening port. Selected volumes can also be shared explicitly. Another Pod does not automatically share that loopback address or filesystem.

A Pod is the scheduling unit. A container is one isolated process environment within it. A namespace here can mean a Kubernetes organizational scope or a Linux isolation mechanism, so keep the meanings distinct. Containers in a Pod have independent process lifecycles and resources despite cooperating closely. Pods are replaceable; a replacement can have a new IP and name. Store durable business data using an appropriate persistence design and access workloads through stable service discovery. Packing unrelated applications into one Pod couples scheduling and lifecycle without creating a stronger independent scaling unit.

Why this matters

Two containers in one Pod can communicate via localhost, while two separate Pods normally require another reachable address.

A common trap

Do not overlook this operational distinction: Pods are replaceable and are not intended as permanent identities for durable business data.

kubectl context and inspection

kubectl sends requests to the cluster selected by its current context. Check context and namespace before changes. get summarizes, describe includes events and detail, and logs retrieves container output. Troubleshooting should move from observed status to relevant events rather than repeatedly reapply unchanged YAML. For example, kubectl config current-context identifies the target; kubectl get pods -n lesson113 scopes inspection to the practice namespace.

WORKED EXAMPLE
kubectl config current-context identifies the target; kubectl get pods -n lesson113 scopes inspection to the practice namespace.

An engineer runs kubectl from a laptop with several contexts. The current context selects cluster credentials and a default namespace, so a familiar command can target the wrong environment. Check context, then supply the intended namespace explicitly for practice changes. Begin inspection with get, move to describe for conditions and events, and use logs for application output.

A context combines cluster, user, and namespace settings. A namespace scopes many resource operations. An event records relevant cluster observations and reasons. Logs come from container output and do not replace scheduling evidence. A missing log may mean the image never started; describe can reveal the pull error first. Use previous-container logs when investigating restarted containers where available. Do not share kubeconfig files as ordinary learning artifacts because they can contain or reference access credentials. Context verification is an execution safety check, not simply a cosmetic terminal label.

Why this matters

kubectl config current-context identifies the target; kubectl get pods -n lesson113 scopes inspection to the practice namespace.

A common trap

Do not overlook this operational distinction: Troubleshooting should move from observed status to relevant events rather than repeatedly reapply unchanged YAML.

KEEP THESE WITH YOU

Today’s takeaways

Cluster API and objects: The control plane exposes the Kubernetes API and stores cluster state. Nodes run workloads. Objects have metadata, a desired spec, and observed status where applicable. Namespaces scope many resource names and permissions, but not every object is namespaced. API acceptance does not guarantee successful scheduling.

Pods and container lifecycle: A Pod is the smallest deployable scheduling unit and can contain cooperating containers sharing network and selected volumes. Containers in one Pod share the Pod’s network namespace. Pods are replaceable and are not intended as permanent identities for durable business data.

kubectl context and inspection: kubectl sends requests to the cluster selected by its current context. Check context and namespace before changes. get summarizes, describe includes events and detail, and logs retrieves container output. Troubleshooting should move from observed status to relevant events rather than repeatedly reapply unchanged YAML.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed