{ "id": "node-label-selector", "title": "Node Labels and nodeSelector", "category": "Cluster Administration", "difficulty": "Easy", "type": "task", "weight": 5, "description": "## Node Labels and nodeSelector\n\nLabelling nodes lets you constrain which nodes a pod can be scheduled on, using `nodeSelector` in the pod spec.\n\n**Your task:**\n\n1. Add the label `disk=ssd` to node `k8s-lab`\n2. Create a Pod named `ssd-pod` using `nginx:alpine` that uses `nodeSelector` to target nodes with `disk=ssd`", "hints": [ { "title": "Label the node", "body": "Use `kubectl label node key=value`.", "command": "kubectl label node k8s-lab disk=ssd --overwrite" }, { "title": "Use nodeSelector in pod spec", "body": "Add `nodeSelector: disk: ssd` under `spec` in the pod manifest.", "command": "cat </dev/null || true" }, { "command": "kubectl delete pod ssd-pod --ignore-not-found --grace-period=0 --force" } ] }