Cluster configuration for GDS teams using the GDS Supported Platform.
- Docker Desktop - Container tooling
- aws-cli - Universal Command Line Interface for Amazon Web Services
- aws-vault - A vault for securely storing and accessing AWS credentials in development environments
- aws-iam-authenticator - A tool to use AWS IAM credentials to authenticate to a Kubernetes cluster
go get -u -v github.com/kubernetes-sigs/aws-iam-authenticator/cmd/aws-iam-authenticator
-
Manually
Create S3 Bucketin the Service Team's AWS accountBucket nameshould resolve togds-re-${AWS_ACCOUNT_NAME}-terraform-stateVersioningshould be opt inDefault encryptionshould be opt in
-
Manually
Create Hosted Zonein the Service Team's AWS accountDomain Nameshould resolve to${AWS_ACCOUNT_NAME}.aws.ext.govsvc.ukTypeshould be set toPublic Hosted Zone- Take a note of:
Hosted Zone IDDomain Name- Zone's
NSrecord type values
-
In the
run-productionAWS account,Create Record Setin the already existing Hosted ZoneNamefield needs to match theDomain Namefrom the previous stepTypefield needs to be set toNS - Name ServerValuefield needs to contain theNSrecords obtained from the Service Team's AWS account
-
Create persistent Terraform
To create your network and other persistent resources for the base of your cluster, copy an existing configuration to manage from under
terraform/accounts/run-sandbox/persistent--you probably want to tweakresources.tfappropriately.This leaves you with a manual steps of:
export AWS_DEFAULT_REGION=eu-west-2 cd terraform/accounts/${AWS_ACCOUNT_NAME}/persistent/${DOMAIN} aws-vault exec run-sandbox -- terraform init -upgrade=true aws-vault exec run-sandbox -- terraform apply
-
Create cluster Terraform
Copy an existing cluster configuration from under
terraform/clusters--you probably want to tweakcluster.tfappropriately.This leaves you with a manual steps of:
export AWS_DEFAULT_REGION=eu-west-2 cd terraform/clusters/${DOMAIN} aws-vault exec run-sandbox -- terraform init -upgrade=true aws-vault exec run-sandbox -- terraform apply
-
Generate a
kubeconfig, apply any generated resources to the cluster, commit thekubeconfig:aws-vault exec run-sandbox -- terraform output kubeconfig > kubeconfig export KUBECONFIG=$(pwd)/kubeconfig aws-vault exec run-sandbox -- kubectl apply -Rf addons/ # This will probably need to be run multiple times git add cluster.tf kubeconfig && git commit # Create branch as usual best practice