FuelLabs / infrastructure

Shared infrastructure templates for Fuel services
15 stars 13 forks source link

Re-factor Terraform EKS Infrastructure Code #131

Closed rfuelsh closed 1 year ago

rfuelsh commented 1 year ago

re-factor eks terraform code - improve it - feel free to take your time

https://github.com/FuelLabs/infrastructure/tree/master/terraform https://github.com/FuelLabs/infrastructure/tree/master/terraform/modules/eks

it gets created by create-k8s.sh (https://github.com/FuelLabs/fuel-deployment/blob/master/.github/workflows/create-k8s.yml)

https://github.com/FuelLabs/infrastructure/blob/master/scripts/create-k8s.sh

Feel free to improve create-k8s.sh

liviudm commented 1 year ago

Here's what I have in mind. My suggestion is to start from scratch. Some changes will most likely break the current setup and clusters will need to be redeployed.

In terms of AWS accounts, each cluster will have a dedicated AWS Account. This is going to be a longer discussion which will involve a multi-account setup, but we can start small and come back to this when the time comes.

In terms of EKS and Terraform this is my proposal:

awfuel commented 1 year ago

I am in agreement with these suggestions.

rfuelsh commented 1 year ago

Thanks @liviudm - for all great suggestions- feel free to start on this when you are ready and create the terraform code- look forward to your work

liviudm commented 1 year ago

VPC code - https://github.com/FuelLabs/infrastructure-tools/commit/ce82ded79906c86cc76fcbec023432af1dc14963

liviudm commented 1 year ago

VPC Flow logs enabled - https://github.com/FuelLabs/infrastructure-tools/commit/d6ec1015af8ae5df3c0147f103b80736c0d8c753

liviudm commented 1 year ago

Initial EKS configuration - https://github.com/FuelLabs/infrastructure-tools/commit/72d151d275bbc777803412d00b500feee38d9d3f

liviudm commented 1 year ago

Karpenter - https://github.com/FuelLabs/infrastructure-tools/commit/37e52c826a18c5a8dd7f806925bc0d0773768030