liveBook · Manning

Kubectl

As explained in Distributed Machine Learning Patterns

kubectl is the command-line client for interacting with Kubernetes clusters and their API resources.

kubectl is the command-line interface for interacting with Kubernetes clusters and inspecting their resources. It provides the operational entry point for exploring cluster state before working with Kubeflow and Argo Workflows. section 8.2

A practical kubectl workflow includes:

  • Inspect cluster nodes with kubectl get nodes and examine a node with kubectl describe node. section 8.2.1
  • Create and isolate project resources in a namespace with kubectl create ns basics. section 8.2.1
  • Create a Pod from a YAML manifest with kubectl create -f, then check its status with kubectl get pods. section 8.2.1
  • Inspect execution output with kubectl logs and retrieve the raw resource definition with kubectl get pod -o yaml. section 8.2.1

Inspecting a completed Pod

After creating the whalesay Pod, kubectl get pods reports its readiness, completion status, restart count, and age. kubectl logs whalesay then exposes the Pod's generated hello-world output. section 8.2.1

Figure 8.2 An architecture diagram of Kubernetes
08-02

Use the Kubernetes architecture diagram to locate kubectl among the cluster's operational components and understand its interaction point. section 8.2

How Distributed Machine Learning Patterns covers it

How deep it goes
Demonstrates basic cluster, namespace, Pod, log, and YAML commands without explaining Kubernetes control-plane components.
Examples
Uses a local k3d cluster, the basics namespace, and a whalesay Pod to demonstrate status, logs, and YAML inspection.
What it assumes
Assumes access to Docker and introduces local Kubernetes setup through k3d and k3s before using kubectl.
What you can do after
Operate/configure a Kubernetes cluster by creating namespaces and Pods, switching contexts, and inspecting status, logs, and YAML.
How it connects
Connects kubectl with Kubernetes clusters, namespaces, Pods, k3d, k3s, Kubeflow, and Argo Workflows.

Also explained in

Compare how 11 books explain kubectl →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.