A production-shaped, security-first Kubernetes platform β 100% GitOps, zero-downtime automated blue-green delivery, cryptographically-verified supply chain, and full-stack observability.
This repository is the single source of truth for an end-to-end DevSecOps platform running on Kubernetes. Every workload, policy, dashboard, and route in the cluster is declared here as code β a human never runs kubectl apply. Argo CD continuously reconciles the live cluster to match main, so the repository is the deployment.
The platform demonstrates the full DevSecOps lifecycle on real infrastructure:
Commit β CI build β keyless image signing β GitOps sync β policy-gated admission β automated smoke-tested blue-green promotion β runtime detection β full observability.
It is deliberately built the way a real platform team would build one: declarative, auditable, secure by default, and self-healing.
| Capability | How it's implemented |
|---|---|
| π Pure GitOps | Argo CD app-of-apps β one root Application fans out to 11 self-healing Applications. Auto-sync, auto-prune, drift correction. |
| π Zero-downtime delivery | Argo Rollouts blue-green with fully automated promotion β measured 0 failed requests across a live cutover. |
| π§ͺ Automated release gates | Smoke tests (AnalysisTemplate) run against the green environment before traffic flips, and against production after β with automatic rollback. |
| π Verified supply chain | Sigstore cosign keyless signing in CI + Kyverno verifyImages admission policy. Unsigned or tampered images are rejected at the API server β even with valid registry credentials. |
| π Policy as Code | Kyverno enforces image provenance; the framework is in place to extend to Pod Security, resource limits, and registry allow-lists. |
| π°οΈ Runtime security | Falco (eBPF) detects suspicious syscalls in real time β Falcosidekick β web UI. |
| π Full-stack observability | Prometheus (metrics) + Loki (logs via Grafana Alloy) + Grafana (unified UI) + Alertmanager. |
| π Secret hygiene | No credential ever lives in git. All secrets are Kubernetes Secrets referenced by name; charts consume them via existingSecret. |
| π Unified HTTPS ingress | Every UI served on 443 through Traefik with path- and host-based routing. |
flowchart TB
subgraph dev["π¨βπ» Developer"]
code["git push"]
end
subgraph ci["βοΈ CI β GitHub Actions (devsecops-pipeline)"]
scan["Scan gates<br/>ESLint Β· npm audit<br/>Gitleaks Β· SonarCloud"] --> build["Build image"]
build --> imgscan["Trivy CVE<br/>+ Syft SBOM"] --> push["Push to Docker Hub"]
push --> sign["cosign keyless sign<br/>+ Rekor transparency log"]
end
subgraph git["π¦ GitOps Repo (this repo β source of truth)"]
root["root-app"] --> apps["11 Argo CD Applications"]
end
subgraph cluster["βΈοΈ k3s Cluster"]
direction TB
argo["Argo CD<br/>(reconcile loop)"]
subgraph delivery["Progressive Delivery"]
rollout["Argo Rollouts<br/>blue-green + smoke tests"]
kyverno["Kyverno<br/>verifyImages admission"]
end
subgraph sec["Security"]
falco["Falco (eBPF)<br/>runtime detection"]
end
subgraph obs["Observability"]
prom["Prometheus"]
loki["Loki + Alloy"]
graf["Grafana"]
end
app["cowsay app<br/>(blue / green)"]
end
code --> build
push -.image.-> app
code --> git
git --> argo
argo --> delivery & sec & obs
kyverno -->|verify signature| app
rollout -->|promote| app
falco -.watches.-> app
obs -.observe.-> app
classDef green fill:#2f7e3f,stroke:#1b5e20,color:#fff
classDef blue fill:#1b98e0,stroke:#0d47a1,color:#fff
class sign,kyverno,falco green
class argo,rollout blue
| Layer | Tools |
|---|---|
| Infrastructure | GCP Compute Engine Β· k3s (lightweight Kubernetes) |
| GitOps / CD | Argo CD (app-of-apps) Β· Argo Rollouts (blue-green) |
| CI Security Scanning | ESLint (SAST) Β· npm audit (SCA) Β· Gitleaks (secrets) Β· SonarCloud (code quality/SAST) Β· Trivy (image CVEs) Β· Syft (SBOM) |
| CI / Supply Chain | GitHub Actions Β· Sigstore cosign (keyless OIDC) Β· Rekor transparency log Β· Docker Hub |
| Policy & Admission | Kyverno β verifyImages, ClusterPolicy |
| Runtime Security | Falco (modern eBPF) Β· Falcosidekick + UI |
| Metrics | Prometheus Β· Alertmanager Β· kube-state-metrics Β· node-exporter |
| Logs | Loki Β· Grafana Alloy (log collector) |
| Dashboards | Grafana (Prometheus + Loki + Alertmanager datasources) |
| Ingress / TLS | Traefik (path + host routing on 443) |
| Packaging | Helm Β· Kustomize (base + overlays) |
The application source lives in a separate repo (devsecops-pipeline) whose GitHub Actions workflow enforces security before an image is ever published. Every push to main runs a fail-fast gauntlet β if any gate fails, no image is built, pushed, or signed. Pull requests run the same scans (build + test) but skip publish/sign, so untrusted code can never produce a signed artifact.
flowchart LR
A["ESLint<br/><sub>SAST Β· lint</sub>"] --> B["npm audit<br/><sub>SCA Β· deps</sub>"]
B --> C["Gitleaks<br/><sub>secret scan</sub>"]
C --> D["SonarCloud<br/><sub>code quality</sub>"]
D --> E["Docker Build<br/><sub>sha + latest</sub>"]
E --> F["Trivy<br/><sub>CVE scan</sub>"]
F --> G["Syft<br/><sub>SBOM</sub>"]
G --> H["Docker Hub<br/><sub>push</sub>"]
H --> I["Cosign<br/><sub>keyless sign</sub>"]
classDef gate fill:#b3261e,stroke:#7f1d1d,color:#fff
classDef build fill:#1b98e0,stroke:#0d47a1,color:#fff
classDef publish fill:#2f7e3f,stroke:#1b5e20,color:#fff
class A,B,C,D,F gate
class E,G build
class H,I publish
| # | Stage | Category | What it does / why it's a gate |
|---|---|---|---|
| 1 | ESLint (--max-warnings=0) |
SAST / lint | Fails on any lint warning β code style and correctness enforced with zero tolerance. |
| 2 | npm audit (--audit-level=high) |
SCA | Fails the build on high/critical vulnerabilities in dependencies. |
| 3 | Gitleaks | Secret scanning | Scans the full history for leaked credentials, tokens, and keys. |
| 4 | SonarCloud | SAST / quality | Deep static analysis β bugs, code smells, security hotspots, coverage. |
| 5 | Docker Build | Packaging | Builds and tags the image with the immutable git SHA and latest. |
| 6 | Trivy (exit-code: 1, CRITICAL,HIGH) |
Image scanning | Fails the build if the built image contains critical/high CVEs. |
| 7 | Syft | SBOM | Generates an SPDX SBOM of the image, uploaded as a build artifact. |
| 8 | Docker Hub push (push only) | Publish | Pushes sha + latest tags β reached only after every gate is green. |
| 9 | Cosign sign (push only) | Supply chain | Keyless signs both tags via GitHub OIDC β the signature Kyverno verifies at admission (next section). |
Least-privilege permissions: the workflow requests only
contents: read,security-events: write,actions: read, andid-token: write(the last enables keyless OIDC signing β no long-lived signing key exists).
This CI job produces the signature that the platform verifies at deploy time β the two halves meet at the Kyverno admission gate below. π
This is the heart of the "Sec" in DevSecOps. It uses keyless signing β there is no private key to steal; trust is rooted in identity.
sequenceDiagram
participant CI as GitHub Actions (CI)
participant Fulcio as Sigstore Fulcio (CA)
participant Rekor as Rekor (transparency log)
participant Reg as Docker Hub
participant K8s as Kubernetes API
participant Kyverno as Kyverno Webhook
CI->>Fulcio: OIDC token "I am CI.yml @ main"
Fulcio-->>CI: short-lived signing certificate (~10 min)
CI->>Reg: push image + signature
CI->>Rekor: record signature (public, immutable)
Note over K8s,Kyverno: later, at deploy time
K8s->>Kyverno: admission review (new Pod)
Kyverno->>Reg: fetch signature
Kyverno->>Rekor: verify inclusion
Kyverno-->>K8s: β
issuer + subject match β admit<br/>β otherwise β REJECT
Kyverno policy (Enforce mode) requires every Pod to carry a cosign signature proving it was built by exactly the GitHub Actions workflow CI.yml on main of the pipeline repo, verified against the Rekor transparency log β then rewrites the tag to an immutable digest (mutateDigest) so what was verified is what runs. An attacker with stolen registry credentials still cannot run a tampered image.
The application is an Argo Rollouts Rollout with a fully automated blue-green strategy.
flowchart LR
A["New image<br/>synced by Argo CD"] --> B["π’ Green ReplicaSet<br/>starts (users still on π΅ Blue)"]
B --> C{"Pre-promotion<br/>smoke tests<br/>(preview URL)"}
C -- "β fail" --> X["Abort β users never affected"]
C -- "β
pass" --> D["β‘ Traffic flips to Green<br/>(instant, zero downtime)"]
D --> E{"Post-promotion<br/>smoke tests<br/>(live URL)"}
E -- "β fail" --> R["βͺ Auto-rollback to Blue<br/>(kept warm 30s)"]
E -- "β
pass" --> F["π’ Green becomes new Blue"]
- No human in the loop β from image push to production cutover is fully automated.
- The gate is real β a broken build fails its smoke tests on the preview environment and never reaches users.
- Verified zero-downtime β a probe fired continuously at cowsay.danindu.site during a real cutover recorded 75/75 successful requests.
- Live and preview β production traffic serves the active (blue) version at cowsay.danindu.site; the next (green) version is exercised on a separate preview host before it is ever promoted.
# Watch a release happen live
kubectl argo rollouts get rollout devsecops -n devsecops --watchA complete metrics-and-logs stack, all reconciled by GitOps:
- Prometheus scrapes the cluster and workloads (bounded retention for a lean footprint).
- Grafana Alloy ships every pod's logs to Loki.
- Grafana ships pre-wired with Prometheus, Loki, and Alertmanager datasources β metrics and logs in one pane.
- Falco streams runtime security events to the Falcosidekick UI (e.g. "Terminal shell in a container" the instant someone
execs into a pod).
.
βββ argocd/
β βββ root-app.yaml # the ONE Application applied by hand β bootstraps everything
β βββ apps/ # app-of-apps: what Argo CD manages
β βββ devsecops-app.yaml # β the application workload
β βββ platform-apps.yaml # β the platform (multi-source)
β
βββ apps/devsecops/ # the application (Kustomize)
β βββ base/
β β βββ rollout.yaml # Argo Rollouts blue-green Rollout
β β βββ analysis-template.yaml # automated smoke tests (release gate)
β β βββ service.yaml # active (blue) service
β β βββ service-preview.yaml # preview (green) service
β βββ overlays/prod/ # environment-specific image pin
β
βββ platform/ # the platform components
βββ kyverno/ # policy engine (Helm)
βββ kyverno-policy/ # cosign image-verification ClusterPolicy
βββ observability/ # kube-prometheus-stack Β· Loki Β· Alloy (Helm + values)
βββ falco/ # runtime security (Helm, eBPF)
βββ argo-rollouts/ # progressive delivery controller (Helm)
βββ ingress/ # Traefik routing for every service
- Bootstrap once:
kubectl apply -f argocd/root-app.yaml. - The root Application watches
argocd/apps/and creates every child Application. - Each child Application deploys its slice of the platform β from Helm registries or from this repo.
- Everything self-heals: manual cluster changes are automatically reverted to match git. Merging to
mainis deploying.
# One command reconstructs the entire platform on a fresh cluster:
kubectl apply -f argocd/root-app.yaml- Zero secrets in git. Every credential is a Kubernetes
Secretreferenced by name (existingSecret); the manifests contain only references. - Admission-time enforcement via Kyverno β bad images can't even be scheduled.
- Runtime detection via Falco eBPF β suspicious behavior is surfaced live.
- TLS everywhere β all UIs are served over HTTPS through Traefik.
- Least privilege β the workload runs as non-root, read-only root filesystem, all Linux capabilities dropped.
- Modern eBPF for Falco instead of kernel modules β no kernel-header build step, works on managed cloud kernels.
- Grafana Alloy over Promtail β Promtail is end-of-life; Alloy is the supported successor.
- Multi-source Argo CD Applications β Helm charts from upstream registries combined with values files from this repo via
$valuesrefs, keeping upstream charts pristine. - Server-Side Apply for large CRDs β avoids the client-side annotation size limit that breaks big policy CRDs.
- Blue-green over rolling update β enables a real, testable pre-production environment and instant rollback.
- Pure GitOps β app-of-apps, self-healing, auto-prune
- CI security gates β ESLint, npm audit, Gitleaks, SonarCloud, Trivy, Syft SBOM
- Keyless image signing (cosign) + admission-time verification (Kyverno)
- Immutable git-SHA image tags produced in CI
- Zero-downtime blue-green with automated smoke-test gates and rollback
- Runtime security (Falco eBPF) and full-stack observability (Prometheus/Loki/Grafana)
- Zero secrets in git β all credentials as referenced Kubernetes Secrets
Built with a GitOps-first, security-by-default philosophy.
Declarative Β· Auditable Β· Self-healing Β· Zero-downtime