# seokpan/seokpan-hybrid-infra architecture

> Architecture diagram of the GitHub repository seokpan/seokpan-hybrid-infra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seokpan/seokpan-hybrid-infra
- Repository: https://github.com/seokpan/seokpan-hybrid-infra

## Overview

This is an infrastructure-as-code repository for a cloud-primary ROSA application with on-premises restore-based recovery. The main operational flow is to provision the persistent AWS foundation and temporary ROSA cluster, bootstrap GitOps, then let the separate GitOps repository manage application desired state. Ansible and controller scripts cover on-prem setup and backup/restore operations. The README documents the root ownership and deployment order; the backup implementation details were not sampled, so those links are documented at subsystem level rather than inferred from code.

Main entry points: [`terraform/rosa/cluster.tf`](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/rosa/cluster.tf) (ROSA cluster), [`terraform/bootstrap/main.tf`](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/bootstrap/main.tf) (State and execution roles), [`terraform/foundation/network.tf`](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/network.tf) (Network foundation), [`ansible`](https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible) (GitOps bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terraform["Terraform Provisioning"]
  node_bootstrap["State and execution roles<br/>[main.tf]"]
  node_state_backend[("Terraform state backend<br/>[backend.tf]")]
end

subgraph group_cloud["AWS Foundation"]
  node_foundation_network["Network foundation<br/>[network.tf]"]
  node_foundation_data[("RDS and Redis<br/>[data_rds.tf]")]
  node_foundation_backup[("Backup storage<br/>[data_backup_s3.tf]")]
  node_foundation_registry["Container registry<br/>[registry.tf]"]
  node_foundation_iam["Shared ROSA IAM<br/>[rosa_iam_roles.tf]"]
end

subgraph group_cluster["ROSA and GitOps"]
  node_rosa_cluster["ROSA cluster<br/>[cluster.tf]"]
  node_rosa_oidc["Cluster OIDC<br/>[oidc.tf]"]
  node_gitops["GitOps desired state"]
  node_ansible_bootstrap["GitOps bootstrap"]
end

subgraph group_recovery["Backup and Recovery"]
  node_onprem_setup["On-prem setup"]
  node_backup_jobs["Backup jobs"]
  node_controller_checks["Restore gates"]
  node_restore_controller["Restore controller<br/>[restore.sh]"]
  node_backup_vm["On-prem backup VM"]
end

node_operator(("Infrastructure operator"))
node_aws["AWS services"]
node_openshift["ROSA runtime"]
node_gitops_repo["GitOps repository"]
node_onprem["On-prem environment"]

node_operator -->|"runs first"| node_bootstrap
node_bootstrap -->|"manages"| node_state_backend
node_bootstrap -->|"precedes"| node_foundation_network
node_foundation_network -->|"provisions network"| node_aws
node_foundation_data -->|"provisions data"| node_aws
node_foundation_backup -->|"provisions storage"| node_aws
node_foundation_registry -->|"provisions registry"| node_aws
node_foundation_iam -->|"provisions roles"| node_aws
node_foundation_network -->|"precedes creation"| node_rosa_cluster
node_operator -->|"creates cluster"| node_rosa_cluster
node_rosa_cluster -->|"creates runtime"| node_openshift
node_rosa_oidc -.->|"configures identity"| node_rosa_cluster
node_rosa_cluster -->|"precedes bootstrap"| node_ansible_bootstrap
node_ansible_bootstrap -->|"installs operator"| node_gitops
node_ansible_bootstrap -->|"registers root app"| node_gitops_repo
node_gitops_repo -->|"syncs desired state"| node_openshift
node_operator -->|"configures host"| node_onprem_setup
node_backup_jobs -.->|"runs on"| node_backup_vm
node_backup_jobs -.->|"uses backup storage"| node_foundation_backup
node_restore_controller -.->|"checks restore gates"| node_controller_checks
node_restore_controller -.->|"restores data"| node_onprem
node_onprem_setup -->|"configures"| node_onprem

click node_bootstrap "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/bootstrap/main.tf"
click node_state_backend "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/bootstrap/backend.tf"
click node_foundation_network "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/network.tf"
click node_foundation_data "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/data_rds.tf"
click node_foundation_backup "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/data_backup_s3.tf"
click node_foundation_registry "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/registry.tf"
click node_foundation_iam "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/rosa_iam_roles.tf"
click node_rosa_cluster "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/rosa/cluster.tf"
click node_rosa_oidc "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/rosa/oidc.tf"
click node_ansible_bootstrap "https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible"
click node_onprem_setup "https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible"
click node_backup_jobs "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/ansible/data/backup-vm/seokpan-hybrid-backup"
click node_controller_checks "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/ansible/data/controller/check_backup_gate.sh"
click node_restore_controller "https://github.com/seokpan/seokpan-hybrid-infra/blob/main/ansible/data/controller/restore.sh"
click node_backup_vm "https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible/data/backup-vm"

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_bootstrap,node_state_backend toneBlue
class node_foundation_network,node_foundation_data,node_foundation_backup,node_foundation_registry,node_foundation_iam toneAmber
class node_rosa_cluster,node_rosa_oidc,node_gitops,node_ansible_bootstrap toneMint
class node_onprem_setup,node_backup_jobs,node_controller_checks,node_restore_controller,node_backup_vm toneRose
class node_operator,node_aws,node_openshift,node_gitops_repo,node_onprem toneIndigo
```

## Components

### Terraform Provisioning

- [State and execution roles](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/bootstrap/main.tf): `terraform/bootstrap/main.tf`
- [Terraform state backend](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/bootstrap/backend.tf): `terraform/bootstrap/backend.tf`

### AWS Foundation

- [Network foundation](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/network.tf): `terraform/foundation/network.tf`
- [RDS and Redis](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/data_rds.tf): `terraform/foundation/data_rds.tf`
- [Backup storage](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/data_backup_s3.tf): `terraform/foundation/data_backup_s3.tf`
- [Container registry](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/registry.tf): `terraform/foundation/registry.tf`
- [Shared ROSA IAM](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/foundation/rosa_iam_roles.tf): `terraform/foundation/rosa_iam_roles.tf`

### ROSA and GitOps

- [ROSA cluster](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/rosa/cluster.tf): `terraform/rosa/cluster.tf`
- [Cluster OIDC](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/terraform/rosa/oidc.tf): `terraform/rosa/oidc.tf`
- **GitOps desired state**
- [GitOps bootstrap](https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible): `ansible`

### Backup and Recovery

- [On-prem setup](https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible): `ansible`
- [Backup jobs](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/ansible/data/backup-vm/seokpan-hybrid-backup): `ansible/data/backup-vm/seokpan-hybrid-backup`
- [Restore gates](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/ansible/data/controller/check_backup_gate.sh): `ansible/data/controller/check_backup_gate.sh`
- [Restore controller](https://github.com/seokpan/seokpan-hybrid-infra/blob/main/ansible/data/controller/restore.sh): `ansible/data/controller/restore.sh`
- [On-prem backup VM](https://github.com/seokpan/seokpan-hybrid-infra/tree/main/ansible/data/backup-vm): `ansible/data/backup-vm`

### Other components

- **Infrastructure operator**
- **AWS services**
- **ROSA runtime**
- **GitOps repository**
- **On-prem environment**

## Connections

- Infrastructure operator → State and execution roles: runs first (evidence: `README.md`)
- State and execution roles → Terraform state backend: manages (evidence: `README.md`)
- State and execution roles → Network foundation: precedes (evidence: `README.md`)
- Network foundation → AWS services: provisions network (evidence: `README.md`)
- RDS and Redis → AWS services: provisions data (evidence: `README.md`)
- Backup storage → AWS services: provisions storage (evidence: `README.md`)
- Container registry → AWS services: provisions registry (evidence: `README.md`)
- Shared ROSA IAM → AWS services: provisions roles (evidence: `README.md`)
- Network foundation → ROSA cluster: precedes creation (evidence: `README.md`)
- Infrastructure operator → ROSA cluster: creates cluster (evidence: `README.md`)
- ROSA cluster → ROSA runtime: creates runtime (evidence: `README.md`)
- Cluster OIDC → ROSA cluster: configures identity
- ROSA cluster → GitOps bootstrap: precedes bootstrap (evidence: `README.md`)
- GitOps bootstrap → GitOps desired state: installs operator (evidence: `README.md`)
- GitOps bootstrap → GitOps repository: registers root app (evidence: `README.md`)
- GitOps repository → ROSA runtime: syncs desired state (evidence: `README.md`)
- Infrastructure operator → On-prem setup: configures host (evidence: `README.md`)
- Backup jobs → On-prem backup VM: runs on
- Backup jobs → Backup storage: uses backup storage
- Restore controller → Restore gates: checks restore gates
- Restore controller → On-prem environment: restores data
- On-prem setup → On-prem environment: configures (evidence: `README.md`)
