The EKS cluster is deployed via Terraform in two stages. See adr-3 for background.
cluster-infrastructure
is concerned only with setting-up the EKS cluster and associated AWS resources (such as the worker groups and auto-scaling groups).cluster-services
is concerned only with setting up the Kubernetes resources and configuration for base services, including theaws-auth
ConfigMap, ingress controller, etc.
cluster-infrastructure
deployment assumes that there is a Fastly CDN service and requires a value (www_dns_validation_rdata
) for creating the DNS validation of the Fastly domain. You can either use a dummy value or look at setting up the CDN servicecluster-services
deployment requires some prerequisite secrets which are not generated automatically. Create these secrets before running the Terraform apply for the first time.
All terraform modules in this repository are now deployed via Terraform Cloud. To test changes before merging into main, open a PR and a plan will automatically start for your branch.
When turning up from scratch, deploy the root modules in this order:
tfc-bootstrap
: bootstraps Terraform Cloud and createstfc-configuration
workspace which manages the other Terraform module workspaces.tfc-configuration
: creates TFC workspaces for each terraform module and environment.ecr
(test and production accounts only): creates the ECR container registry from which the cluster pull container images. There is a single registry for all of the environments (to avoid consistency problems with image tags and having to copy images between registries), so this module is not deployed per-environment.cluster-infrastructure
: creates the AWS resources for the cluster.govuk-publishing-infrastructure
: creates AWS resources specific to the GOV.UK apps where we are not yet able to manage those resources via Kubernetes.cluster-services
: deploys the base services into the cluster.
- Configure an OIDC connection between each AWS environment and Terraform Cloud.
- Create an IAM role named
terraform-cloud
in each AWS environment.- See example permissions policy and trust policy.
- Apply the
tfc-bootstrap
module locally. This will create thetfc-configuration
workspace, which will create all of the remaining workspaces.
See the README.md for the module:
AWS_DEFAULT_REGION=eu-west-1
gds aws govuk-test-admin -e -- bash -l
aws eks update-kubeconfig --name govuk
kubectl get nodes