https://github.com/sebastiendan/terraform-aks-microservices
🚀All inclusive terraform recipe for micro-services architecture deployed on Kubernetes (AKS), from ECR docker images (AWS), with Route53 DNS records (AWS), Traefik load balancer, Let's Encrypt SSL certs, MySQL one-DB-per-microservice, blob storage
https://github.com/sebastiendan/terraform-aks-microservices
aks aws aws-route53 azure azure-blob docker kubernetes mysql terraform traefik traefik-ingress
Last synced: 6 months ago
JSON representation
🚀All inclusive terraform recipe for micro-services architecture deployed on Kubernetes (AKS), from ECR docker images (AWS), with Route53 DNS records (AWS), Traefik load balancer, Let's Encrypt SSL certs, MySQL one-DB-per-microservice, blob storage
- Host: GitHub
- URL: https://github.com/sebastiendan/terraform-aks-microservices
- Owner: sebastiendan
- Created: 2019-02-18T03:22:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-18T05:04:03.000Z (over 6 years ago)
- Last Synced: 2025-03-29T10:51:18.524Z (6 months ago)
- Topics: aks, aws, aws-route53, azure, azure-blob, docker, kubernetes, mysql, terraform, traefik, traefik-ingress
- Language: HCL
- Homepage:
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# terraform-aks-microservices
## What is this?
An all inclusive terraform recipe for micro-services architecture deployed on Kubernetes (AKS), from ECR docker images (AWS), with Route53 DNS records (AWS), Traefik load balancer, Let's Encrypt SSL certs, MySQL one-DB-per-microservice, blob storage, and much more...## Run the whole stack (e. g. in a CI pipelines)
- # docker login
- eval $(aws ecr get-login --no-include-email)- # provision db server
- cd db-server
- terraform init
- terraform apply -auto-approve
- cd ..- # provision blob storage
- cd blob-storage
- terraform init
- terraform apply -auto-approve
- export TF_VAR_BLOB_STORAGE_ACCOUNT_NAME=$(terraform output account_name)
- export TF_VAR_BLOB_STORAGE_ACCOUNT_ACCESS_KEY=$(terraform output account_access_key)
- cd ..- # provision the cluster
- export TF_VAR_CLIENT_ID=${ARM_CLIENT_ID}
- export TF_VAR_CLIENT_SECRET=${ARM_CLIENT_SECRET}
- cd cluster
- terraform init
- terraform apply -auto-approve- # export KUBECONFIG
- mkdir ~/.kube
- terraform output kube_config > ~/.kube/aksconfig
- export KUBECONFIG=~/.kube/aksconfig
- cd ..- # deploy traefik
- cd traefik
- kubectl apply -f ./ingress-role.yaml
- terraform init
- terraform apply -auto-approve -var "AWS_ACCESS_KEY_ID=$ACME_AWS_ACCESS_KEY_ID" -var "AWS_SECRET_ACCESS_KEY=$ACME_AWS_SECRET_ACCESS_KEY" -var "AWS_HOSTED_ZONE_ID=$AWS_HOSTED_ZONE_ID"
- kubectl apply -f ./ingress.yaml
- export EXTERNAL_IP=$(terraform output external_ip)
- cd ..- # deploy services
- cd services
- terraform init
- terraform apply -auto-approve
- cd ..- # set dns
- cd dns
- terraform init
- terraform apply -auto-approve -var "external_ip=$EXTERNAL_IP"