Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asishgouda/go-web-app-devops
This is the Complete CI/CD implementation for the Golang Application.
https://github.com/asishgouda/go-web-app-devops
argocd aws aws-ec2 docker-hub gitops helm-charts kubernetes
Last synced: about 1 month ago
JSON representation
This is the Complete CI/CD implementation for the Golang Application.
- Host: GitHub
- URL: https://github.com/asishgouda/go-web-app-devops
- Owner: ASISHGOUDA
- License: apache-2.0
- Created: 2024-11-12T04:45:07.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-19T05:48:21.000Z (about 1 month ago)
- Last Synced: 2024-11-19T06:32:15.222Z (about 1 month ago)
- Topics: argocd, aws, aws-ec2, docker-hub, gitops, helm-charts, kubernetes
- Language: HTML
- Homepage:
- Size: 203 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-DevOps.md
- License: LICENSE
Awesome Lists containing this project
README
# DevOpsify the go web application
The main goal of this project is to implement DevOps practices in the Go web application. The project is a simple website written in Golang. It uses the `net/http` package to serve HTTP requests.
DevOps practices include the following:
- Creating Dockerfile (Multi-stage build)
- Containerization
- Continuous Integration (CI)
- Continuous Deployment (CD)## Summary Diagram
![image](https://github.com/user-attachments/assets/45f4ef12-c5b5-4247-9d43-356b5dfb671b)## Creating Dockerfile (Multi-stage build)
The Dockerfile is used to build a Docker image. The Docker image contains the Go web application and its dependencies. The Docker image is then used to create a Docker container.
We will use a Multi-stage build to create the Docker image. The Multi-stage build is a feature of Docker that allows you to use multiple build stages in a single Dockerfile. This will reduce the size of the final Docker image and also secure the image by removing unnecessary files and packages.
## Containerization
Containerization is the process of packaging an application and its dependencies into a container. The container is then run on a container platform such as Docker. Containerization allows you to run the application in a consistent environment, regardless of the underlying infrastructure.
We will use Docker to containerize the Go web application. Docker is a container platform that allows you to build, ship, and run containers.
Commands to build the Docker container:
```bash
docker build -t /go-web-app .
```Command to run the Docker container:
```bash
docker run -p 8080:8080 /go-web-app
```Command to push the Docker container to Docker Hub:
```bash
docker push /go-web-app
```## Continuous Integration (CI)
Continuous Integration (CI) is the practice of automating the integration of code changes into a shared repository. CI helps to catch bugs early in the development process and ensures that the code is always in a deployable state.
We will use GitHub Actions to implement CI for the Go web application. GitHub Actions is a feature of GitHub that allows you to automate workflows, such as building, testing, and deploying code.
The GitHub Actions workflow will run the following steps:
- Checkout the code from the repository
- Build the Docker image
- Run the Docker container
- Run tests## Continuous Deployment (CD)
Continuous Deployment (CD) is the practice of automatically deploying code changes to a production environment. CD helps to reduce the time between code changes and deployment, allowing you to deliver new features and fixes to users faster.
We will use Argo CD to implement CD for the Go web application. Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It allows you to deploy applications to Kubernetes clusters using Git as the source of truth.
The Argo CD application will deploy the Go web application to a Kubernetes cluster. The application will be automatically synced with the Git repository, ensuring that the application is always up to date.
## Conclusion