kubectl is the command-line tool for working with Kubernetes API objects. With a valid certificate in kubeconfig and the necessary role-based access, it can create, read, update, and delete resources. Run `kubectl api-resources` to see which resource types a cluster exposes. section 1.4
Choose the command to match the intended change:
- `kubectl create -f my-pod-manifest.yaml` creates a resource and errors if it already exists. section 1.9
- `kubectl apply -f my-pod-manifest.yaml` creates or updates a resource toward the state described in YAML. section 1.9
- `kubectl replace -f my-pod-manifest.yaml` replaces the resource; replacing a Deployment triggers a new rollout. section 1.9
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
This Pod manifest specifies an nginx container. Save it as `my-pod-manifest.yaml` to use with the create or apply commands above. section 1.9
Inspect and verify a cluster change
For a Service CIDR change, `kubectl get servicecidr` shows the current range; run it again after the change to check the new range. `kubectl get svc -A` then lists Services across namespaces so their assigned cluster IPs can be checked. Use `-n kube-system` when a command must target that namespace. section 6.1
For CKA tasks, check which cluster the question targets before acting. The exam environment provides `k` as an alias for `kubectl`; autocomplete and careful copying help avoid mistakes in long resource names. section 1.1 section 6.1










