๐ Project Docs โข ๐๏ธ Architecture โข โ๏ธ Pipeline โข ๐ Monitoring โข ๐ Setup
This project demonstrates a production-grade DevSecOps CI/CD pipeline for Appwrite - an open-source Firebase alternative with 54k+ GitHub stars. The pipeline automates the entire software delivery lifecycle from code commit to production deployment with integrated security scanning, container orchestration, and full-stack observability.
Why Appwrite? Appwrite is a real-world, enterprise-grade platform used by thousands of developers globally. Deploying it with a full DevSecOps pipeline demonstrates the ability to handle complex, multi-service architectures - exactly what companies like IBM, HCL, and Visa use in production.
| Feature | Details |
|---|---|
| CI/CD Tool | Jenkins with 11 automated pipeline stages |
| Security | SonarQube SAST + Trivy CVE scanning (image + filesystem) |
| Registry | DockerHub โ 20+ versioned image tags |
| Orchestration | Kubernetes (k3s) with Helm charts |
| Observability | Prometheus + Grafana + Alertmanager |
| Notifications | Real-time Slack alerts on every deployment |
| Pipeline Time | ~1 min 37 sec end-to-end |
Jenkins Stage View โ Build #20 (All Green โ )
SonarQube Quality Gate โ PASSED
Trivy Security Report โ 3 HIGH CVEs detected
DockerHub โ 9 image tags published
Slack Alert โ Deployment notification
Live metrics across all 4 pods โ Appwrite, MariaDB, MongoDB, Redis
| Panel | Metric | Description |
|---|---|---|
| Running Pods | 4 |
Total healthy pods |
| Total Restarts | 4 |
Pod restart count |
| CPU Usage % | 3.24% |
Cluster CPU utilization |
| Memory Usage | 194 MB |
Total memory used |
| Firing Alerts | 5 |
Active Alertmanager alerts |
| Cluster Health | 1 |
Healthy nodes |
| CPU per Pod | Time series | Per-pod CPU over time |
| Memory per Pod | Time series | Per-pod memory over time |
| Network I/O | Time series | Network in/out per pod |
| Security Panel | Table | Pod privileged status |
| Deployment Frequency | Graph | Jenkins deployments/hour |
| Active Alerts | List | CPUThrottling, ControllerDown |
- CPUThrottlingHigh # CPU throttle > threshold
- KubeControllerManagerDown # Controller manager health
- KubeDeploymentReplicasMismatch # Replica count mismatch
- PodCrashLoopBackOff # Pod restart loop
- HighMemoryUsage # Memory > 85%| Category | Tool | Version | Purpose |
|---|---|---|---|
| Source Control | GitHub | - | Code hosting + webhook triggers |
| CI/CD | Jenkins | 2.555.1 | Pipeline automation |
| Code Quality | SonarQube | 9.9.8 | SAST + quality gate |
| Security Scan | Trivy | 0.70.0 | CVE + secret scanning |
| Containerization | Docker | 29.4.1 | Image build + registry |
| Registry | DockerHub | - | Image storage (20+ tags) |
| Orchestration | Kubernetes (k3s) | v1.36.0 | Container orchestration |
| Package Manager | Helm | v3.20.2 | K8s application packaging |
| Database | MariaDB | 10.11 | Relational database |
| Cache/Queue | Redis | 7.2 | Cache + message queue |
| Document DB | MongoDB | 5.0 | Document store |
| Metrics | Prometheus | - | Metrics collection |
| Dashboards | Grafana | - | Visualization |
| Alerting | Alertmanager | - | Alert routing |
| Notifications | Slack | - | Deployment alerts |
| IaC | Helm Charts | - | Declarative K8s config |
appwrite-devsecops/
โ
โโโ ๐ Jenkinsfile # 11-stage CI/CD pipeline
โโโ ๐ sonar-project.properties # SonarQube configuration
โโโ ๐ .gitignore # Secrets excluded
โ
โโโ ๐ helm/
โ โโโ ๐ appwrite/
โ โโโ ๐ Chart.yaml # Helm chart metadata
โ โโโ ๐ values.yaml # Image tag + config
โ โโโ ๐ templates/
โ โโโ ๐ deployment.yaml # Appwrite Deployment
โ โโโ ๐ service.yaml # ClusterIP/NodePort
โ โโโ ๐ ingress.yaml # Ingress rules
โ
โโโ ๐ k8s/
โ โโโ ๐ namespace.yaml # appwrite namespace
โ โโโ ๐ mariadb.yaml # MariaDB StatefulSet
โ โโโ ๐ mongodb.yaml # MongoDB StatefulSet
โ โโโ ๐ redis.yaml # Redis StatefulSet
โ
โโโ ๐ monitoring/
โโโ ๐ servicemonitor.yaml # Prometheus ServiceMonitor
โโโ ๐ alert-rules.yaml # Custom alert rules (CPU, Memory, Pod crash)
โโโ ๐ prometheus-values.yaml # Prometheus Helm chart override values
โโโ ๐ grafana-dashboard.json # Custom Grafana dashboard (import-ready JSON)
# Required tools
docker --version # Docker 29.x+
kubectl version # v1.36.x+
helm version # v3.20.x+
trivy --version # 0.70.x+git clone https://github.com/omprakash2929/appwrite-devsecops
cd appwrite-devsecops
git checkout dev# Install k3s
curl -sfL https://get.k3s.io | sh -
# Setup kubeconfig
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $USER:$USER ~/.kube/config
# Verify
kubectl get nodes# Install Jenkins
sudo apt install openjdk-17-jdk jenkins -y
sudo systemctl start jenkins
# Install Docker for Jenkins
sudo apt install docker.io -y
sudo usermod -aG docker jenkins
sudo systemctl restart jenkinsRequired Plugins:
โ
Docker Pipeline
โ
SonarQube Scanner
โ
Kubernetes CLI
โ
Slack Notification
Required Credentials:
โ
dockerhub-creds (Username + Password/PAT)
โ
SonarQube-Token (Secret Text)
โ
github-token (Secret Text)
New Item โ Pipeline โ appwrite-devsecops
Definition: Pipeline script from SCM
SCM: Git
URL: https://github.com/omprakash2929/appwrite-devsecops
Branch: */dev
Script Path: Jenkinsfile
# Add Helm repos
helm repo add prometheus-community \
https://prometheus-community.github.io/helm-charts
helm repo update
# Install monitoring stack
kubectl create namespace monitoring
helm install monitoring \
prometheus-community/kube-prometheus-stack \
--namespace monitoring \
--set grafana.adminPassword=admin123
# Access Grafana
kubectl port-forward svc/monitoring-grafana \
3000:80 -n monitoring
# Open: http://localhost:3000 (admin/admin123)| Metric | Value |
|---|---|
| Total Builds | 20+ builds |
| Successful Builds | Build #20 โ |
| Pipeline Duration | ~1 min 37 sec |
| Docker Image Size | 536 MB |
| DockerHub Pulls | 65+ |
| CVEs Detected | 3 HIGH (reported) |
| SonarQube Score | A (all categories) |
| Quality Gate | PASSED โ |
| K8s Pods Running | 4/4 |
| Grafana Dashboards | Production-grade |
- Designing and implementing multi-stage Jenkins pipelines with parallel execution
- Integrating SonarQube for static analysis and quality gates in CI/CD
- Container vulnerability scanning with Trivy โ understanding CVE severity levels
- Kubernetes resource management โ Deployments, StatefulSets, Services, PVCs
- Helm chart development for parameterized, reusable Kubernetes deployments
- Setting up full observability with Prometheus ServiceMonitors and Grafana dashboards
- Configuring Alertmanager rules and Slack webhook integrations
- Debugging real production issues โ CrashLoopBackOff, MongoDB connection pools, kubeconfig authentication
- k3s single-node cluster setup as a cost-effective production-like environment
- Fix Appwrite pod stability โ complete all required MongoDB connection pools
- Add OWASP Dependency Check stage to pipeline
- Implement multi-node k3s cluster for HA
- Add Loki + Promtail for centralized log aggregation
- Integrate Jaeger for distributed tracing
- Add automated rollback on deployment failure
- Implement GitFlow with PR-based deployments
- Add network policies for pod-to-pod security
Omprakash Chauhan
โญ Star this repo if you found it helpful!
Built with โค๏ธ as a portfolio DevSecOps project
Add badges from somewhere like: shields.io









