{
  "id": "pod-labeling-basics",
  "title": "Labelling Resources",
  "category": "Core Concepts",
  "difficulty": "Easy",
  "type": "task",
  "weight": 3,
  "description": "## Labelling Resources\n\nLabels are key-value pairs attached to objects, used to organize and select subsets of objects. A pod named `app-worker` is currently running, but it's missing a required label.\n\n**Your task:**\n\nAdd the label `tier=frontend` to the existing pod `app-worker`.\n\n```bash\n# Verify labels\nkubectl get pod app-worker --show-labels\n```",
  "hints": [
    {
      "title": "Use kubectl label",
      "body": "You can label resources imperatively without editing the YAML.",
      "command": "kubectl label pod app-worker tier=frontend"
    }
  ],
  "setup_commands": [
    {
      "command": "kubectl run app-worker --image=nginx:alpine"
    }
  ],
  "validation": {
    "commands": [
      {
        "description": "Pod has label tier=frontend",
        "command": "kubectl get pod app-worker -o jsonpath='{.metadata.labels.tier}'",
        "expected_output": "frontend",
        "match": "exact"
      }
    ]
  },
  "default_namespace": "default",
  "teardown_commands": [
    {
      "command": "kubectl delete pod app-worker --ignore-not-found --grace-period=0 --force"
    }
  ]
}
