Giter VIP home page Giter VIP logo

sebastiendan / terraform-aks-microservices Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 3.0 12 KB

๐Ÿš€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

HCL 100.00%
terraform kubernetes aks mysql traefik traefik-ingress docker azure azure-blob aws aws-route53

terraform-aks-microservices's Introduction

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"

terraform-aks-microservices's People

Contributors

sebastiendan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.