EvAsCo is a sample code to demonstrate infrastructure automation, immutable application deployment and versioning using Docker, Kubernetes, Helm and Terraform on Azure Cloud.
- Following softwares are prequisite to successfully run this project.
- Docker
- Kubectl
- Helm
- Terraform
- Azure Service role credentials: Configure these credentials in cluster/cred.tfvars.
$ cd cluster
$ chmod +x ./init.sh
$ ./init.sh
After successfully running, above command will print a url of the application running on azure cluster. API documentation can be found at ApiDocs.
- Initialize Terraform.
- Creates Kubernetes Cluster and Cosmos DB in Azure.
- Add Consmos DB connection string as Kubernetes Secret.
- Initialize kubeconfig and helm.
- Deploy docker image in Kubernetes
- Map service ip to a DNS.
By default docker hub is being used as docker repository which can be configured in helm chart. Docker image of application which is in directory "app" can be found at Messages
$ export CONNECTION=<YOUR_MONGODB_CONNECTION_STRING>
$ cd app
$ node index.js
To Run Test:
$ export CONNECTION=<YOUR_MONGODB_CONNECTION_STRING>
$ cd app
$ npm test
Visit http://localhost:1337 to view application.
$ export CONNECTION=<YOUR_MONGODB_CONNECTION_STRING>
$ cd app
$ docker build -t <TAG_NAME> ./
$ docker run -p 1337:1337 -e CONNECTION=$CONNECTION
Visit http://localhost:1337 to view application.
$ helm list
$ helm rollback release_name release_version
It will rollback the deployed application to required version.
This project usees a number of open source technology:
- Terraform - Write, Plan, and Create Infrastructure as Code.
- Docker - contenarization.
- Kubernetes - Container Orchestration.
- Helm - The package manager for Kubernetes.
- node.js - JavaScript runtime.
- Express - fast node.js network app framework
- VueJs - The Progressive JavaScript Framework
- bootstrap-vue - Bootstrap + Vue
- Integrating in CI/CD pipeline.
- Code Improvement
MIT
Free Software, Hell Yeah!