It a simple API backend app, that has only POST
and GET
method for adding and fetching resources.
Resources contain two field, name
and url
.
For example, you want to share a resource for Kubernetes
you can add the Link
to that resource.
Sample_
ID | Name | URL |
---|---|---|
1 | Kubernetes | https://kubernetes.io/docs/home/ |
2 | Git Crypt | https://dev.to/heroku/how-to-manage-your-secrets-with-git-crypt-56ih |
-
Pipeline: 3 jobs in total. Jobs are...
- Update Changelog
- It will update the
CHANGELOG.md
on each commit with the commit message.
- Test and Deploy
- It will run a
db instance
in docker container. - Execute the
db-migration
job in docker baseddb
instance. - Run the
unit test
fordb connection
andsimple db query
.
- Build and Push Docker Image
- It will
build
theDockerfile
and push the image todockerhub
repository with last6 character of the commit hash
asimage tag
.
-
Deployment: Used tools like
Docker
,Kubernetes
,Helm Chart
andHelmfile
. Components are..- Application Deployment Chart Using
Helm Chart
andHelmfile
. Nginx
as Proxy server.MySQL
as database.
Deployment contains 2 files_
helmfile.yaml
: Application deployment chart.helmfile-services.yaml
: MySQL and Nginx deployment chart.
- Application Deployment Chart Using
-
Terraform: A simple terraform configuration for
AWS-S3
andCloudFront
to accessS3-Object
viaCloudfront
.
- Kubernetes (Docker-Desktop).
- Helm.
- Helmfile.
Service deployments_
- Execute the command below to check the configurations_
helmfile -f helmfile-services.yaml diff
- To deploy execute command_
helmfile -f helmfile-services.yaml sync
Wait for a while to get the database ready to accept connection_
-
Set the latest tag. Images are pushed here_ https://hub.docker.com/repository/docker/mahin96/sre-project/general
export tag=a99f30
-
Then to check application deployment_
helmfile diff
-
To deploy the application_
helmfile sync
-
Use the command below to make a
POST
request with resources_curl -X POST \ http://localhost/api/v1/resource/create \ -H 'Content-Type: application/json' \ -d '{ "name": "Kubernetes", "url": "https://kubernetes.io/docs/home/" }' ; \ curl -X POST \ http://localhost/api/v1/resource/create \ -H 'Content-Type: application/json' \ -d '{ "name": "Git Crypt", "url": "https://dev.to/heroku/how-to-manage-your-secrets-with-git-crypt-56ih" }'
-
Use the command below to
GET
the resources_curl -X GET http://localhost/api/v1/resource/list