Skip to main content

How to Investigate Divergence Errors

The divergence pipelines alert us if the state of the cluster does not match the source code in our git repositories.

Usually, the pipeline failure will include the terraform plan output that explains exactly what has diverged.

Reproduce the plan

To run the same terraform plan command as the pipeline does:

  • Ensure you have the following environment variables set:
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
  • Start in a working copy of the cloud-platform-infrastructure repo
  • cd into the directory matching the pipeline which is failing:
Pipeline Directory
divergence-kops terraform/cloud-platform
divergence-k8s-components terraform/cloud-platform-components
divergence-eks terraform/cloud-platform-eks
divergence-eks-components terraform/cloud-platform-eks/components
divergence-networking terraform/cloud-platform-network
  • Check you’re using the correct terraform workspace (e.g. terraform workspace select live)
  • Check you’re targeting the correct kubernetes cluster, by running kubectl cluster-info
  • Run the terraform plan
terraform init
terraform plan

You should see the same differences as reported in the divergence pipeline.

This page was last reviewed on 10 April 2024. It needs to be reviewed again on 10 July 2024 by the page owner #cloud-platform .
This page was set to be reviewed before 10 July 2024 by the page owner #cloud-platform. This might mean the content is out of date.