liveBook · Manning

Goal-seeking

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A configuration approach that specifies a desired end state while leaving the path to that state to the system.

Goal-seeking specifies the desired Kubernetes end state without prescribing the order or commands required to reach it. Submit a YAML manifest to the Kubernetes API, and the control plane reconciles current state toward the declared state. section 1.9

Choose the submission command according to the resource state:

  • Use kubectl create -f when the resource should not already exist. section 1.9
  • Use kubectl apply -f to create or update an existing resource. section 1.9
  • Use kubectl replace -f to delete and recreate the resource, triggering a new Deployment rollout when applicable. section 1.9

Declare an nginx Pod

Define a Pod manifest with an nginx container, then submit it declaratively with kubectl create -f my-pod-manifest.yaml. Kubernetes selects and performs the path to the requested state. section 1.9

apiVersion: v1
kind: Pod
metadata:
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - image: nginx
    name: nginx

Inspect the concise YAML manifest structure for an nginx Pod. section 1.9

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains desired-state reconciliation, YAML manifests, and submission commands, but stops short of detailing the control plane’s path selection.
Examples
Uses an nginx Pod manifest and contrasts kubectl create, apply, and replace.
What you can do after
Operate/configure Kubernetes resources by submitting YAML with kubectl create, apply, or replace.
How it connects
Connects declarative syntax with YAML manifests, the Kubernetes API, control-plane reconciliation, and kubectl.

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.