KCNA ยท Kubernetes core concepts
kubectl basics
Core kubectl verbs (get, describe, apply, create, delete, explain), output formats, imperative vs declarative commands.
Key points
- kubectl is the command-line client for the Kubernetes API.
- Read verbs: get (list), describe (details and events), explain (field docs).
- Write verbs: create (imperative, fails if the object exists), apply (declarative, creates or updates from a manifest) and delete.
- Output formats such as -o yaml, -o json or -o name change how results are printed.
Source: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_create/kubectl_create_deployment/
Practice questions
Which kubectl verb prints detailed, human-readable information about an object, including its recent events?
- kubectl explain
- kubectl describe
- kubectl apply
- kubectl create
Show answer
Answer: B. kubectl describe
describe aggregates the object's details and related events. explain documents the schema, not a live object.
Which kubectl verbs only read information and never change cluster objects?
- get
- delete
- describe
- apply
- explain
Show answer
Answer: A. get, C. describe, E. explain
get, describe and explain are read-only. delete removes objects and apply creates or updates them.
When the object already exists, kubectl create -f and kubectl apply -f behave the same way.
Show answer
Answer: False
create is imperative and reports an error for an existing object. apply is declarative and updates it to match the manifest.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
