# beast-lucifer-666/zero-downtime-deployment-engine architecture

> Architecture diagram of the GitHub repository beast-lucifer-666/zero-downtime-deployment-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/beast-lucifer-666/zero-downtime-deployment-engine
- Repository: https://github.com/beast-lucifer-666/zero-downtime-deployment-engine

## Overview

This repository is a zero-downtime deployment demo: an operator rolls out a new version, checks readiness and (for canaries) error rates, then shifts traffic or rolls back. The application exposes health, readiness, and metrics endpoints; Kubernetes resources provide rollout and traffic-routing primitives, with Prometheus/Grafana monitoring. The control panel separately reads and patches the active service. Unsampled deployment scripts and Kubernetes resources are included only where README capabilities establish their role; internal wiring beyond that is not inferred.

Main entry points: [`scripts/deploy-blue-green.sh`](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-blue-green.sh) (Blue/green deploy), [`scripts/deploy-canary.sh`](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-canary.sh) (Canary deploy), [`k8s/monitoring.yaml`](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/monitoring.yaml) (Monitoring stack), [`scripts/canary-gate.sh`](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/canary-gate.sh) (Error-rate gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_service["Demo service<br/>[server.js]"]
  node_health["Health checks<br/>[health-check.sh]"]
end

subgraph group_release["Release strategies"]
  node_bluegreen["Blue/green deploy"]
  node_canary["Canary deploy<br/>[deploy-canary.sh]"]
  node_gate["Error-rate gate<br/>[canary-gate.sh]"]
  node_rollback["Rollback<br/>[rollback.sh]"]
  node_promote["Promotion<br/>[promote.sh]"]
  node_inactive["Inactive rollout<br/>[deploy-inactive.sh]"]
end

subgraph group_traffic["Traffic control"]
  node_control["Control panel<br/>[server.js]"]
  node_bgrollout["Blue/green rollout<br/>[rollout.yaml]"]
  node_canaryrollout["Canary rollout<br/>[rollout.yaml]"]
  node_canaryingress["Canary ingress<br/>[ingress.yaml]"]
  node_preview["Preview service"]
  node_active["Active service"]
end

subgraph group_observability["Monitoring"]
  node_monitoring["Monitoring stack<br/>[monitoring.yaml]"]
  node_prometheus["Prometheus scrape"]
  node_grafana["Grafana dashboard"]
end

node_operator(("Operator"))

node_operator -->|"starts rollout"| node_bluegreen
node_operator -->|"starts rollout"| node_canary
node_operator -->|"switches versions"| node_control
node_control -->|"patches selector"| node_active
node_bluegreen -->|"deploys color"| node_bgrollout
node_bluegreen -->|"exposes candidate"| node_preview
node_bluegreen -->|"switches traffic"| node_active
node_canary -->|"progresses stages"| node_canaryrollout
node_canary -->|"updates weights"| node_canaryingress
node_canary -->|"runs gate"| node_gate
node_gate -->|"triggers on failure"| node_rollback
node_operator -->|"promotes release"| node_promote
node_operator -->|"restores version"| node_rollback
node_operator -.->|"deploys inactive"| node_inactive
node_health -.->|"checks readiness"| node_service
node_monitoring -->|"deploys scraper"| node_prometheus
node_monitoring -->|"deploys dashboard"| node_grafana
node_prometheus -->|"scrapes metrics"| node_service

click node_service "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/app/src/server.js"
click node_health "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/health-check.sh"
click node_control "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/control-panel/server.js"
click node_bluegreen "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-blue-green.sh"
click node_canary "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-canary.sh"
click node_gate "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/canary-gate.sh"
click node_rollback "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/rollback.sh"
click node_promote "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/promote.sh"
click node_inactive "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-inactive.sh"
click node_bgrollout "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/blue-green/rollout.yaml"
click node_canaryrollout "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/canary/rollout.yaml"
click node_canaryingress "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/canary/ingress.yaml"
click node_preview "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/services/preview-service.yaml"
click node_active "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/services/active-service.yaml"
click node_monitoring "https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/monitoring.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_service,node_health toneBlue
class node_bluegreen,node_canary,node_gate,node_rollback,node_promote,node_inactive toneAmber
class node_control,node_bgrollout,node_canaryrollout,node_canaryingress,node_preview,node_active toneMint
class node_monitoring,node_prometheus,node_grafana toneRose
class node_operator toneIndigo
```

## Components

### Application

- [Demo service](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/app/src/server.js): `app/src/server.js`
- [Health checks](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/health-check.sh): `scripts/health-check.sh`

### Release strategies

- [Blue/green deploy](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-blue-green.sh): `scripts/deploy-blue-green.sh`
- [Canary deploy](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-canary.sh): `scripts/deploy-canary.sh`
- [Error-rate gate](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/canary-gate.sh): `scripts/canary-gate.sh`
- [Rollback](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/rollback.sh): `scripts/rollback.sh`
- [Promotion](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/promote.sh): `scripts/promote.sh`
- [Inactive rollout](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/scripts/deploy-inactive.sh): `scripts/deploy-inactive.sh`

### Traffic control

- [Control panel](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/control-panel/server.js): `control-panel/server.js`
- [Blue/green rollout](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/blue-green/rollout.yaml): `k8s/blue-green/rollout.yaml`
- [Canary rollout](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/canary/rollout.yaml): `k8s/canary/rollout.yaml`
- [Canary ingress](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/canary/ingress.yaml): `k8s/canary/ingress.yaml`
- [Preview service](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/services/preview-service.yaml): `k8s/services/preview-service.yaml`
- [Active service](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/services/active-service.yaml): `k8s/services/active-service.yaml`

### Monitoring

- [Monitoring stack](https://github.com/beast-lucifer-666/zero-downtime-deployment-engine/blob/main/k8s/monitoring.yaml): `k8s/monitoring.yaml`
- **Prometheus scrape**
- **Grafana dashboard**

### Other components

- **Operator**

## Connections

- Operator → Blue/green deploy: starts rollout (evidence: `README.md`)
- Operator → Canary deploy: starts rollout (evidence: `README.md`)
- Operator → Control panel: switches versions (evidence: `control-panel/server.js`)
- Control panel → Active service: patches selector (evidence: `control-panel/server.js`)
- Blue/green deploy → Blue/green rollout: deploys color (evidence: `README.md`)
- Blue/green deploy → Preview service: exposes candidate (evidence: `README.md`)
- Blue/green deploy → Active service: switches traffic (evidence: `README.md`)
- Canary deploy → Canary rollout: progresses stages (evidence: `README.md`)
- Canary deploy → Canary ingress: updates weights (evidence: `README.md`)
- Canary deploy → Error-rate gate: runs gate (evidence: `README.md`)
- Error-rate gate → Rollback: triggers on failure (evidence: `README.md`)
- Operator → Promotion: promotes release (evidence: `README.md`)
- Operator → Rollback: restores version (evidence: `README.md`)
- Operator → Inactive rollout: deploys inactive
- Health checks → Demo service: checks readiness
- Monitoring stack → Prometheus scrape: deploys scraper (evidence: `README.md`)
- Monitoring stack → Grafana dashboard: deploys dashboard (evidence: `README.md`)
- Prometheus scrape → Demo service: scrapes metrics (evidence: `README.md`)
