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:
- Start in a working copy of the cloud-platform-infrastructure repo
cdinto the directory matching the pipeline which is failing:
- Check you’re using the correct terraform workspace (e.g.
terraform workspace select live-1)
- Check you’re targeting the correct kubernetes cluster, by running
- Run the terraform plan
terraform init terraform plan
You should see the same differences as reported in the divergence pipeline.