π‘οΈ DevSecOps Platform with GitOps
A production-oriented DevSecOps platform demonstrating how multiple applications can be built, secured, and deployed through different CI platforms while sharing a centralized GitOps-based Continuous Delivery layer on Kubernetes.
This platform delivers two independent applications through two different CI platforms , both converging on a single centralized GitOps deployment layer managed by Argo CD.
Application
Source Control
CI Platform
Security Tools
Spring Boot
GitHub
Jenkins
SonarQube, Syft, Grype, OWASP ZAP
Bootstrap 5
GitLab
GitLab CI
Trivy, Gitleaks, Hadolint, CycloneDX
Both pipelines update a shared GitOps repository . Argo CD watches the repository and deploys automatically β neither pipeline ever runs kubectl directly.
DEVELOPERS
β
βββββββββββββββββ΄ββββββββββββββββ
β β
βΌ βΌ
GitHub GitLab
(Spring Boot App) (Bootstrap App)
β β
βΌ βΌ
Jenkins GitLab CI
Kubernetes Agents Kubernetes Runner
β β
ββββββββββ΄βββββββββ ββββββββββ΄βββββββββββ
β SonarQube β β Hadolint β
β Maven + Nexus β β Kaniko Build β
β Kaniko Build β β Trivy Image Scan β
β Syft + Grype β β Trivy Config Scan β
β GitOps Update β β Gitleaks β
β OWASP ZAP β β CycloneDX SBOM β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββββ
β β
βββββββββββββββββ¬ββββββββββββββββ
β
βΌ
GitOps Manifests Repository
(Single Source of Truth)
β
βΌ
Argo CD
App of Apps
β
ββββββββββββββ΄βββββββββββββ
βΌ βΌ
spring-boot-app bootstrap-app
β β
ββββββββββββββ¬βββββββββββββ
β
βΌ
Kubernetes Cluster
namespace: apps
π Related Repositories
Repository
Purpose
Link
devsecops-gitops-platform
Platform infrastructure + Spring Boot CI
GitHub
bootstrap-devops-app
Bootstrap application + GitLab CI pipeline
GitLab
gitops-manifests
Centralized GitOps manifests (SSOT)
GitHub
1. Developer pushes code
β
βΌ
2. CI pipeline triggers (Jenkins or GitLab CI)
β
βΌ
3. Build β Security Scan β Image Push to Docker Hub
β
βΌ
4. Update image tag in GitOps manifests repository
β
βΌ
5. Argo CD detects the Git change
β
βΌ
6. Argo CD syncs β Kubernetes deploys the new version
β
βΌ
7. (Jenkins only) OWASP ZAP scans the live application
No CI pipeline ever runs kubectl apply or deploys directly to Kubernetes.
Git is the only deployment trigger. Argo CD is the only deployer.
Layer
Tool
Spring Boot
Bootstrap
Code Quality
SonarQube
β
β
Dockerfile Lint
Hadolint
β
β
Secret Detection
Gitleaks
β
β
Rootless Image Build
Kaniko
β
β
SBOM Generation
Syft / CycloneDX
β
β
CVE Scanning
Grype / Trivy
β
β
IaC Scanning
Trivy Config
β
β
Runtime DAST
OWASP ZAP
β
β
All components run on a Kubernetes (Kind) cluster.
Component
Namespace
Installed Via
Jenkins
jenkins
Helm
SonarQube
sonarqube
Helm
Nexus Repository
nexus
Helm
Argo CD
argocd
Kustomize
GitLab Runner
gitlab-runner
Helm
Spring Boot App
apps
Argo CD (GitOps)
Bootstrap App
apps
Argo CD (GitOps)
π Repository Structure
devsecops-gitops-platform/ β This repository
βββ spring-boot-app/ β Spring Boot source code
β βββ src/
β βββ pom.xml
β βββ Dockerfile
βββ helm-values/ β Helm values (Jenkins, SonarQube, Nexus)
β βββ jenkins-values.yaml
β βββ sonarqube-values.yaml
β βββ nexus-values.yml
βββ kustomize-manifests/ β Kustomize (Argo CD install)
β βββ argocd/
β βββ kustomization.yaml
βββ Jenkinsfile β Jenkins CI pipeline
βββ syft-grype.Dockerfile β Custom Syft + Grype image
βββ jenkins-rbac.yaml β Jenkins RBAC
βββ README.md
kubectl create namespace jenkins
kubectl create namespace sonarqube
kubectl create namespace nexus
kubectl create namespace argocd
kubectl create namespace gitlab-runner
kubectl create namespace apps
kubectl apply -f jenkins-rbac.yaml
3. Install Helm Components
helm repo add jenkins https://charts.jenkins.io
helm repo add sonarqube https://SonarSource.github.io/helm-chart-sonarqube
helm repo add sonatype https://sonatype.github.io/helm3-charts/
helm repo add gitlab https://charts.gitlab.io
helm repo update
helm install my-jenkins jenkins/jenkins -n jenkins -f helm-values/jenkins-values.yaml
helm install sonarqube sonarqube/sonarqube -n sonarqube -f helm-values/sonarqube-values.yaml
helm install nexus sonatype/nexus-repository-manager -n nexus -f helm-values/nexus-values.yml
helm install gitlab-runner gitlab/gitlab-runner -n gitlab-runner -f gitlab-runner-values.yaml
4. Install Argo CD (Kustomize)
# Use server-side apply to avoid CRD size limits
kubectl apply -k kustomize-manifests/argocd/ --server-side --force-conflicts
cd gitops-manifests
kubectl apply -f app-of-apps.yaml
# Jenkins
kubectl get secret --namespace jenkins my-jenkins \
-o jsonpath=" {.data.jenkins-admin-password}" | base64 --decode
# Nexus
kubectl exec -it < nexus-pod> -n nexus -- cat /nexus-data/admin.password
# Argo CD
kubectl get secret --namespace argocd argocd-initial-admin-secret \
-o jsonpath=" {.data.password}" | base64 --decode
kubectl port-forward svc/my-jenkins -n jenkins 8080:8080
kubectl port-forward svc/sonarqube-sonarqube -n sonarqube 9000:9000
kubectl port-forward svc/nexus-nexus-repository-manager -n nexus 8081:8081
kubectl port-forward svc/argocd-server -n argocd 8083:443
# 1. Recreate cluster
kind create cluster --config kind-config.yaml
# 2. Recreate namespaces
kubectl create namespace jenkins sonarqube nexus argocd gitlab-runner apps
# 3. Apply RBAC
kubectl apply -f jenkins-rbac.yaml
# 4. Reinstall Helm components
helm install my-jenkins jenkins/jenkins -n jenkins -f helm-values/jenkins-values.yaml
helm install sonarqube sonarqube/sonarqube -n sonarqube -f helm-values/sonarqube-values.yaml
helm install nexus sonatype/nexus-repository-manager -n nexus -f helm-values/nexus-values.yml
helm install gitlab-runner gitlab/gitlab-runner -n gitlab-runner -f gitlab-runner-values.yaml
# 5. Reinstall Argo CD
kubectl apply -k kustomize-manifests/argocd/ --server-side --force-conflicts
# 6. Deploy App of Apps
kubectl apply -f gitops-manifests/app-of-apps.yaml
# 7. Recreate Jenkins credentials (docker-cred, nexus-cred, sonarqube-token, github-cred)
# 8. Regenerate SonarQube token (My Account β Security)
# 9. Reconfigure Nexus Maven proxy (maven-central-proxy + maven-public group)
Issue
Cause
Fix
SonarQube/Nexus pods restarting
Probe timeouts too short
Increase initialDelaySeconds, timeoutSeconds, failureThreshold in Helm values
Nexus PVC stuck Terminating
Incomplete cleanup
Force-delete namespace and reinstall
Argo CD CRD too large for kubectl apply
annotation size limit (262KB)
Use --server-side --force-conflicts
ZAP: directory /zap/wrk not mounted
No volume for report output
Mount emptyDir at /zap/wrk in ZAP pod spec
kubectl cp fails on completed pod
Pod already exited
Keep container alive with sleep 300 after scan
Jenkins RBAC: pods/log forbidden
Missing permissions
Add pods/log and pods/exec to jenkins-rbac.yaml
GitLab Runner not picking up jobs
Wrong executor or token
Verify runnerRegistrationToken and executor: kubernetes in Helm values
Phase
Description
Status
1
Jenkins CI/CD β Spring Boot
β
Complete
2
Argo CD GitOps
β
Complete
3
GitLab CI β Bootstrap App
β
Complete
4
App of Apps
β
Complete