infra | ||
init-state | ||
modules | ||
.gitignore | ||
backend.tf | ||
Makefile | ||
README.md | ||
terragrunt.hcl |
avx-pmarie-aws-infra
Initialization
Run terraform
into the init-state
directory to create initial s3 & dynamodb.
Make sure to use the correct region:
$ set -x AWS_DEFAULT_REGION eu-west-3
Initial deployment
Because of the uncreated dependencies, it is required to do extra step on a full deployment. It is required to create first the VPC, then the EKS cluster, then ebs-addon-csi-driver, then kube-prometheus-stack and finally the last other components:
$ cd infra/vpc && terragrunt plan && terragrunt apply
...
$ cd ../../ && make apply
Validate, plan & apply
There is a Makefile
for this:
$ make validate
$ make plan
$ make apply
Extract EKS configuration
$ aws eks update-kubeconfig --name avx-pmarie-eks --region eu-west-3
$ kubectl config rename-context arn:aws:eks:eu-west-3:563042046245:cluster/avx-pmarie-eks avx-pmarie-eks
Notes
aws-auth
It can be required to import existing aws-auth configmap:
$ cd infra/eks-aws-auth
$ terragrunt import kubernetes_config_map.aws_auth kube-system/aws-auth
...
ebs-csi-driver
The driver is installed and managed as cluster addons in eks
. It is required to annotate the service account & to restart the controller so the created role in eks-addon-csi-ebs
is updated.