A complete DevSecOps pipeline project demonstrating secure CI/CD, containerization, Kubernetes deployment, and full observability using Prometheus and Grafana.
This project simulates a real-world, production-grade deployment lifecycle, integrating continuous integration, continuous deployment, automated security scanning, and system monitoring.
This project adopts a modern GitOps/DevOps approach by separating application code from infrastructure definitions:
- SecureKubeOps: The application code (Node.js/JavaScript) and the CI/CD pipeline (GitHub Actions, Dockerfile).
- securekubeops-infra: The infrastructure configurations, Kubernetes manifests, and Helm charts for deploying the application and monitoring stack.
This project goes beyond basic scripting by implementing a true DevSecOps flow. Here is the current state of the architecture:
We have built the backbone of the pipeline:
- Code push triggers the pipeline (on the
mainbranch). - Automated workflow execution using GitHub Actions.
- Impact: Event-driven automation is fully implemented, demonstrating a real DevOps flow rather than relying on manual local scripts.
The application is successfully containerized:
- Built secure, non-root Docker images.
- Standardized the application environment.
- Impact: Everything in the pipeline depends on containers, effectively eliminating "works on my machine" problems.
The application is deployed into a local Kubernetes cluster:
- Running locally via Minikube.
- Created robust
DeploymentandServiceconfigurations. - Impact: Demonstrates a solid understanding of pods, deployments, services, and running real workloads in a cluster.
Security scanning is automated within the pipeline:
- Integrated Trivy vulnerability scanner.
- Scans Docker images for CVEs before deployment.
- Impact: This is a major step from standard DevOps to DevSecOps—we are not just deploying code; we are proactively securing it.
Observability is fully implemented:
- Metrics collection via Prometheus.
- Dashboard visualization via Grafana.
- Application metrics exposed via a custom
/metricsendpoint and scraped using aServiceMonitor. - Impact: Complete visibility into system health, implementing production-grade monitoring concepts.
Everything is connected in a seamless, automated lifecycle:
- Code pushed → GitHub
- GitHub Actions triggered
- Docker image built
- Image scanned for vulnerabilities (Trivy)
- Image pushed to Docker Hub
- App deployed to Kubernetes
- Metrics collected (Prometheus)
- Dashboards visualized (Grafana)
✅ Result: A fully working DevSecOps pipeline simulating a real-world deployment lifecycle using industry-standard tools end-to-end.
- Application: Node.js, JavaScript
- Containerization: Docker
- Orchestration: Kubernetes (Minikube)
- CI/CD: GitHub Actions
- Security: Trivy
- Monitoring: Prometheus, Grafana, Helm
Note: Make sure to clone the securekubeops-infra repository for the Kubernetes and monitoring manifest files.
minikube start --driver=docker# Assuming you are in the infra repository directory
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yamlminikube service securekubeops-servicehelm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install monitoring prometheus-community/kube-prometheus-stackGrafana:
kubectl port-forward svc/monitoring-grafana 3000:80
# Open: http://localhost:3000Prometheus:
kubectl port-forward svc/monitoring-kube-prometheus-prometheus 9090:9090
# Open: http://localhost:9090kubectl apply -f monitoring/service-monitor.yamlThis project was not just about building, but also debugging real issues:
- Kubernetes ImagePullBackOff: Fixed by aligning image names and ensuring successful Docker Hub pushes.
- Docker Authentication Failure: Resolved by replacing standard passwords with scoped access tokens.
- CI/CD Deployment Failure: Addressed hybrid deployment approaches when GitHub Actions runners couldn't access local Minikube.
- Prometheus Not Detecting App: Fixed by properly aligning
app=securekubeopslabels on Kubernetes Services and ServiceMonitors. - Metrics Not Available: Learned to wait for pod readiness and verify the metrics server API.
- CI/CD pipelines run in isolated environments; networking and auth must be explicitly handled.
- Kubernetes services rely heavily on precise label matching.
- Monitoring systems depend on proper service discovery configuration.
- Small configuration mismatches can break entire pipelines.
- Debugging is a core DevOps skill.
- Slack/Email alerting integration via Alertmanager.
- Advanced custom Grafana dashboards.
- Multi-environment setup (dev/staging/prod).
- Deployment automation using cloud-managed Kubernetes (EKS/GKE).
Saim Zaib
Cybersecurity & DevOps Enthusiast
MIT — see LICENSE.