anchor.diff:          - name: app
             image: "${DOCKER_IMAGE}"
             ports:
  +            # TODO: replace with the correct port for your application
               - containerPort: 3000
   ```
   
  -<section class="Docs__note">
  -  <p>
  -    Please refer to the official Kubernetes <a
  -    href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">deployment
  -    documentation</a> for more information. Also note that there are multiple
  -    ways to deploy applications to Kubernetes.
  -  </p>
  -</section>
  -
  -Now create a short deploy script (`script/buildkite/deploy`):
  +Note manifest includes `${DOCKER_IMAGE}`. There is no environment variable
  +subsitution in YAML or `kubectl` itself. This is where the deploy script comes
  +in. The deploy script can use `envsubst` ("environment subsitute";
  +[docs](https://linux.die.net/man/1/envsubst)) as a minimal templating solution.
  +The resulting output may be piped directly into `kubectl`.
  +
  +The full script has three parts:
  +
  +1. Check `$DOCKER_IMAGE` is set
  +2. Generate a complete manifest with `envsubt` and apply with `kubectl`
  +3. Wait for Kubernetes to complete the deploy.
  +
  +This fits neatly into a Bash script. Here's the complete `script/buildkite/deploy`:
   
   ```bash
   #!/usr/bin/env bash
  
positive.code: settings ensures only one step runs at a time, effectively creating a deploy
  queue.
  
  Now the pipeline is wired up. Time for the deploy step.
  
  ## Setup the Deploy Step
  
  Create a Kubernetes deployment manifest that references the `DOCKER_IMAGE`
  environment variable. `kubectl` does not interpolate environment variables out
  of the box, so you'll need a different solution. The `envsubst` command works
  well for this case. `envsubst` ("environment substitute") replaces environment
  variables from standard input. The result may be piped directly to `kubectl`.
  
  First, You'll need a deployment YML file. Call this file `k8s/deployment.yml`:
  
  ```yml
  ---
  
negative.code: 
  ## Automate Deployments
  
  We can do better than manual deployments. We'll use a [trigger
  steps](https://buildkite.com/docs/pipelines/trigger-step) to connect the test
  and deploy pipelines.
  
  Add these steps to your existing `.buildkite/pipeline.yml`. Be sure to add a
  `wait` step before the tirgger otherwise deploys will trigger at the wrong
  time and even for failed builds!
  
  The example `trigger` step creates a build with the same message, commit, and
  branch. `buildkite-agent pipeline-upload` interpolates environment variables so
  the correct values are replaced when the pipeline starts. The `env` setting
  passes along the `DOCKER_IMAGE` environment variable. Remember, this Docker
  image must be build and pushed in a subsequent step.
  
  Lastly, the `branches` options indicates to only build on `master`. This
  prevents deploying unexpected topic branches.
  
  ```yml
    # Add a wait step to only deploy after all steps complete
    - wait
  
    - label: ':rocket: Deploy'
      # TODO: replace with your deploy pipeline's name
      trigger: kubernetes-tutorial-deploy
      # Only trigger on master build
      build:
        message: "${BUILDKITE_MESSAGE}"
        commit: "${BUILDKITE_COMMIT}"
  