https://github.com/idvoretskyi/gitops-demo
https://github.com/idvoretskyi/gitops-demo
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/idvoretskyi/gitops-demo
- Owner: idvoretskyi
- Created: 2025-06-18T09:08:15.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-18T09:53:25.000Z (12 months ago)
- Last Synced: 2025-06-18T10:29:44.923Z (12 months ago)
- Language: Dockerfile
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# GitOps Demo with Flux
This repository demonstrates GitOps principles using Flux CD with a simple Node.js application.
## Structure
```
├── flux-system/ # Flux CD system configuration
├── clusters/dev/ # Environment-specific configurations
├── apps/demo-app/ # Kubernetes manifests for the demo application
├── demo-app/ # Source code for the demo application
└── .github/workflows/ # CI/CD pipeline
```
## Demo Application
A simple Node.js 24 Express application that provides:
- Health check endpoint at `/health`
- Basic API response at `/`
## GitOps Workflow
1. **Code Changes**: Push changes to the `demo-app/` directory
2. **CI Pipeline**: GitHub Actions builds and pushes container image
3. **Manifest Update**: Pipeline updates Kubernetes manifests with new image tag
4. **Flux Sync**: Flux detects changes and deploys to cluster
## Setup Instructions
### Prerequisites
- Kubernetes cluster
- Flux CLI installed
- kubectl configured
### Install Flux
```bash
# Install Flux in the cluster
flux bootstrap github \
--owner=idvoretskyi \
--repository=gitops-demo \
--branch=main \
--path=./clusters/dev
```
### Local Development
```bash
# Run the demo app locally
cd demo-app
npm install
npm start
```
### Build Docker Image
```bash
cd demo-app
docker build -t gitops-demo-app:latest .
docker run -p 3000:3000 gitops-demo-app:latest
```
## Monitoring
Access the application:
- Health check: `curl http://localhost:3000/health`
- Main endpoint: `curl http://localhost:3000/`