ssh ckad00026
Your job is to edit /home/candidate/credible-mite/web.yaml so it uses APIs supported on Kubernetes 1.29+, then deploy it into namespace garfish.
Because I can’t see your file from here, the most reliable exam approach is:
run a server-side dry-run to reveal the exact deprecated/removed APIs and schema errors
edit the manifest to the modern API versions/fields
re-run dry-run until it passes
apply for real and verify rollout
1) Go to the manifest and run a server-side dry-run
cd /home/candidate/credible-mite
ls -l
sed -n '1,200p' web.yaml
Make sure the namespace exists:
kubectl get ns garfish || kubectl create ns garfish
Now run a server-side dry-run (this catches removed APIs on the cluster):
kubectl apply -n garfish -f web.yaml --dry-run=server
Whatever errors you get here tell you exactly what to fix.
2) Fix the common v1.15 → v1.29 API deprecations
Edit the file:
vi web.yaml
Below are the most common objects from older manifests and how to update them for 1.29+.
A) Deployments / DaemonSets / StatefulSets
Old (v1.15 often used):
New:
Also in apps/v1, .spec.selector is required and must match the pod template labels.
Example conversion:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx
Key rule:
spec.selector.matchLabels must exactly match spec.template.metadata.labels (at least for the keys you select on).
B) Ingress
Old:
New:
Required changes:
spec.rules.http.paths[].pathType is required (usually Prefix)
backend format changes from serviceName/servicePort to service.name/service.port.number (or .name for named ports)
Old backend:
backend:
serviceName: web
servicePort: 80
New backend:
backend:
service:
name: web
port:
number: 80
Full path example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
spec:
rules:
- host: example.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80
C) CronJob
Old:
New:
Most fields stay the same; just update apiVersion.
D) PodDisruptionBudget
Old:
New:
spec.selector/minAvailable/maxUnavailable remain, but apiVersion changes.
E) RBAC
Usually already:
F) Removed APIs you must delete/replace
If you see these in a v1.15-era manifest, they are removed in modern clusters:
PodSecurityPolicy (policy/v1beta1) is removed. You cannot deploy it on 1.29+. Remove it from the manifest (or replace with whatever your environment uses, but for CKAD tasks you usually delete PSP sections from the file).
Some old admission/alpha resources also removed.
If dry-run complains “no matches for kind … in version …”, that’s your cue.
3) Re-run dry-run until it succeeds
After you edit:
kubectl apply -n garfish -f web.yaml --dry-run=server
Keep iterating until there are no errors.
4) Deploy for real
kubectl apply -n garfish -f /home/candidate/credible-mite/web.yaml
5) Verify everything in namespace garfish
List what was created:
kubectl -n garfish get all
kubectl -n garfish get ingress 2>/dev/null || true
If there is a Deployment, verify rollout:
kubectl -n garfish get deploy
kubectl -n garfish rollout status deploy --all
Check pods/events if something fails:
kubectl -n garfish get pods -o wide
kubectl -n garfish describe pod
kubectl -n garfish get events --sort-by=.lastTimestamp | tail -n 30
Submit