Interview Prep/Real-World Interview/Write-a-Kubernetes-manifest tasks

Fix this YAML that fails with "mapping values are not allowed here".

BeginnerHands-onWrite-a-Kubernetes-manifest tasks
Answer

Broken:

containers:
  - name: app
    image: myapp:1.0
    command: ["sh", "-c", "echo starting: now && ./run"]
    env:
      - name: GREETING
        value: Hello: world

Fixed:

    env:
      - name: GREETING
        value: "Hello: world"

Key trick → An unquoted : inside a plain scalar starts a new mapping. Quote values that contain : , #, or start with *, &, { or [. Also quote "yes", "no", "on" and numbers you want as strings.

All Real-World Interview questions Roadmap: Interview readiness

More on Write-a-Kubernetes-manifest tasks