This repository contains a simple Go web application with a CI/CD pipeline using GitHub Actions, Docker, Kubernetes, Helm and ArgoCD.
- Project Structure
- Project Workflow
- Getting Started
- Building and Running
- CI/CD Pipeline
- Kubernetes Deployment
- License
.
├── .github/workflows/ci.yaml # GitHub Actions workflow for CI/CD
├── .gitignore # Git ignore file
├── Dockerfile # Dockerfile for building the application
├── go.mod # Go module file
├── helm/ # Helm chart for Kubernetes deployment
│ ├── go-webapp-helm/
│ │ ├── .helmignore
│ │ ├── Chart.yaml
│ │ ├── templates/
│ │ │ ├── manifests/
│ │ │ │ ├── deployment.yaml
│ │ │ │ ├── ingress.yaml
│ │ │ │ ├── service.yaml
│ │ ├── values.yaml
├── k8s/ # Kubernetes manifests
│ ├── manifests/
│ │ ├── deployment.yaml
│ │ ├── ingress.yaml
│ │ ├── service.yaml
├── LICENSE # License file
├── main.go # Main application file
├── main_test.go # Test file for the application
├── static/ # Static HTML files
│ ├── about.html
│ ├── contact.html
│ ├── courses.html
│ ├── home.html
- Go 1.22 or later
- Docker
- Kubernetes cluster
- Helm
- ArgoCD on cluster
-
Clone the repository:
git clone https://github.com/iam-veeramalla/go-web-app.git cd go-web-app -
Install dependencies:
go mod download
go build -o go-webapp ../go-webappThe application will be available at http://localhost:8080/courses.
The CI/CD pipeline is defined using GitHub Actions in .github/workflows/ci.yaml. It includes the following jobs:
- Build: Builds the Go application.
- Unit tests: Runs the unit tests.
- Code quality: Runs static code analysis using
golangci-lint. - Docker: Builds and pushes the Docker image to Docker Hub.
- Update Helm chart: Updates the Helm chart with the new Docker image tag.
- Install the application using helm chart:
helm install <name-of-application-stack> -n <name-of-namespace> . -f .\values.yaml --create-namespace
- Apply the Kubernetes manifests:
kubectl apply -f k8s/manifests/
Changes in values.yaml file detected by argoCD.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
