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: 
  ## Automate Deployments
  
  [Trigger steps](https://buildkite.com/docs/pipelines/trigger-step) connect
  pipelines. Add a trigger step to the existing test pipeline to trigger the
  deploy pipeline. You may also filter out branches with the `branches` option
  and set environment variables. Remember to set the `DOCKER_IMAGE` environment
  variable.
  
  Add these steps to your existing `.buildkite/pipeline.yml`:
  
  ```yml
    # Add a wait step to only deploy after all steps complete
    - wait
  
    - label: ':rocket: Deploy'
      trigger: kubernetes-tutorial-deploy
      branches: "master"
      build:
        message: "${BUILDKITE_MESSAGE}"
        commit: "${BUILDKITE_COMMIT}"
  
negative.code: # Deploying to Kubernetes
  
  <%= estimated_time "30 minutes" %>
  
  <%= toc %>
  
  This tutorial shows how to deploy to Kubernetes using separate test and deploy
  [pipelines][]. Separating pipelines like this is best practice. The test
  pipeline runs tests and push a Docker image to a registry. The deploy pipelines
  uses the `DOCKER_IMAGE` enviornment variable to create a [Kubernetes
  deployment][k8s_deployment] via `kubectl`. Then, you'll see how to link them
  together to automate deploys from master.
  
  First up, you need to add a step to your existing test pipline that pushes a
  Docker image. Also check your agents have `kubectl` access to your target
  cluster. Refer to the notes at the end of tutorial for tips on setting this
  up.
  
  <%= image "final_test_pipeline.png" %>
  
  Let's go.
  
  ## Create the Deploy Pipeline
  
  This section covers creating a new Buildkite pipeline that loads steps from
  `.buildkite/pipeline.deploy.yml`. Deploy pipelines are like any other pipeline
  except they're triggred by events other than code pushes. We'll use a [trigger
  steps](https://buildkite.com/docs/pipelines/trigger-step) later on to connect
  the test and deploy pipelines.
  
  Create a [new pipeline](https://buildkite.com/new) for your repo. Use
  `buildkite-agent pipeline upload .buildkite/pipeline.deploy.yml` for the first
  step as shown in the image.
  
  <%= image "new_pipeline.png" %>
  
  Now create `.buildkite/pipeline.deploy.yml` with a single step. We'll write the
  deploy script in the next step.
  
  ```yml
  steps:
  