avx-pmarie-aws-infra/README.md

56 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2022-07-01 14:12:11 +02:00
# avx-pmarie-aws-infra
## Initialization
Run `terraform` into the `init-state` directory to create initial s3 & dynamodb.
2023-04-04 17:01:16 +02:00
Make sure to use the correct region:
```sh
$ set -x AWS_DEFAULT_REGION eu-west-3
```
2022-12-09 18:08:49 +01:00
## 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:
```sh
$ cd infra/vpc && terragrunt plan && terragrunt apply
...
$ cd ../../ && make apply
```
2022-07-01 14:12:11 +02:00
## Validate, plan & apply
There is a `Makefile` for this:
```sh
$ 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
...
2022-12-09 18:08:49 +01:00
```
### 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.