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-core | terraform/cloud-platform-eks/core |
divergence-eks-components | terraform/cloud-platform-eks/core/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 16 October 2024.
It needs to be reviewed again on 16 January 2025
by the page owner #cloud-platform
.
This page was set to be reviewed before 16 January 2025
by the page owner #cloud-platform.
This might mean the content is out of date.