0) SSH to the correct host
ssh ckad00044
(Optional sanity)
kubectl config current-context
kubectl get ns | grep rapid-goat
1) Inspect the Deployment and current container name
kubectl -n rapid-goat get deploy busybox
kubectl -n rapid-goat get deploy busybox -o jsonpath='{.spec.template.spec.containers[*].name}{"\n"}'
kubectl -n rapid-goat get deploy busybox -o jsonpath='{.spec.template.spec.containers[*].image}{"\n"}'
Note the current container name (likely something like busybox). We need to rename it to musl.
2) Edit the Deployment (best for renaming container)
Renaming a container is easiest with edit:
kubectl -n rapid-goat edit deploy busybox
In the editor, find:
spec:
template:
spec:
containers:
- name:
image:
Change it to:
- name: musl
image: busybox:musl
Save and exit.
3) Ensure the rollout happens and completes
kubectl -n rapid-goat rollout status deploy busybox
4) Verify the new Pod template is correct
Check the Deployment template:
kubectl -n rapid-goat get deploy busybox -o jsonpath='{.spec.template.spec.containers[0].name}{"\n"}{.spec.template.spec.containers[0].image}{"\n"}'
Check running Pods and the image actually used:
kubectl -n rapid-goat get pods -o wide
POD=$(kubectl -n rapid-goat get pods -l app=busybox -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)
If you don’t have that label selector, just pick a pod name from kubectl get pods and:
kubectl -n rapid-goat describe pod | sed -n '/Containers:/,/Conditions:/p'