# akane-push/terraform-flight-predict architecture

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

- Interactive diagram: https://gitdiagram.com/akane-push/terraform-flight-predict
- Repository: https://github.com/akane-push/terraform-flight-predict

## Overview

This repository provisions and configures the infrastructure for Flight-predict; the application itself lives in a separate repository. The documented workflow is Terraform on OVH to create VMs, Ansible to configure them, then Terraform/Helm to deploy to K3s. The README marks application deployment and full CI automation as unfinished. No source excerpts were provided, so relationships below rely on the README; role-level implementation details are represented without inferred call chains.

Main entry points: [`ansible/inventory`](https://github.com/akane-push/terraform-flight-predict/tree/main/ansible/inventory) (Host inventory), [`terraform/vms.tf`](https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/vms.tf) (VM resources), [`ansible/roles/gitlab-runner/tasks/main.yml`](https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/gitlab-runner/tasks/main.yml) (GitLab runners), [`terraform-k3s`](https://github.com/akane-push/terraform-flight-predict/tree/main/terraform-k3s) (Helm deployment config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["VM provisioning"]
  node_vm_resources["VM resources<br/>[vms.tf]"]
  node_ssh_keys["SSH key setup<br/>[ssh.tf]"]
  node_firewall["Firewall example"]
  node_vm_outputs["VM outputs<br/>[outputs.tf]"]
end

subgraph group_configuration["Host configuration"]
  node_ansible_inventory["Host inventory"]
  node_common_role["Common setup<br/>[main.yml]"]
  node_docker_role["Docker setup<br/>[main.yml]"]
  node_k3s_role["K3s setup<br/>[main.yml]"]
  node_runner_role["GitLab runners<br/>[main.yml]"]
end

subgraph group_deployment["Cluster deployment"]
  node_helm_config["Helm deployment config"]
end

node_operator(("Operator"))
node_ovh["OVH Cloud"]
node_gitlab["GitLab"]
node_k3s_cluster["K3s cluster"]

node_operator -->|"runs Terraform"| node_vm_resources
node_vm_resources -->|"provisions VMs"| node_ovh
node_operator -->|"configures hosts"| node_ansible_inventory
node_ansible_inventory -->|"targets servers"| node_k3s_role
node_ansible_inventory -->|"targets runner"| node_docker_role
node_ansible_inventory -->|"registers runners"| node_runner_role
node_runner_role -->|"registers with"| node_gitlab
node_operator -.->|"deploys charts"| node_helm_config
node_helm_config -.->|"deploys to"| node_k3s_cluster

click node_vm_resources "https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/vms.tf"
click node_ssh_keys "https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/ssh.tf"
click node_firewall "https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/firewall.tf.example"
click node_vm_outputs "https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/outputs.tf"
click node_ansible_inventory "https://github.com/akane-push/terraform-flight-predict/tree/main/ansible/inventory"
click node_common_role "https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/common/tasks/main.yml"
click node_docker_role "https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/docker/tasks/main.yml"
click node_k3s_role "https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/k3s/tasks/main.yml"
click node_runner_role "https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/gitlab-runner/tasks/main.yml"
click node_helm_config "https://github.com/akane-push/terraform-flight-predict/tree/main/terraform-k3s"

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_vm_resources,node_ssh_keys,node_firewall,node_vm_outputs toneBlue
class node_ansible_inventory,node_common_role,node_docker_role,node_k3s_role,node_runner_role toneAmber
class node_helm_config toneMint
class node_operator,node_ovh,node_gitlab,node_k3s_cluster toneIndigo
```

## Components

### VM provisioning

- [VM resources](https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/vms.tf): `terraform/vms.tf`
- [SSH key setup](https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/ssh.tf): `terraform/ssh.tf`
- [Firewall example](https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/firewall.tf.example): `terraform/firewall.tf.example`
- [VM outputs](https://github.com/akane-push/terraform-flight-predict/blob/main/terraform/outputs.tf): `terraform/outputs.tf`

### Host configuration

- [Host inventory](https://github.com/akane-push/terraform-flight-predict/tree/main/ansible/inventory): `ansible/inventory`
- [Common setup](https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/common/tasks/main.yml): `ansible/roles/common/tasks/main.yml`
- [Docker setup](https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/docker/tasks/main.yml): `ansible/roles/docker/tasks/main.yml`
- [K3s setup](https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/k3s/tasks/main.yml): `ansible/roles/k3s/tasks/main.yml`
- [GitLab runners](https://github.com/akane-push/terraform-flight-predict/blob/main/ansible/roles/gitlab-runner/tasks/main.yml): `ansible/roles/gitlab-runner/tasks/main.yml`

### Cluster deployment

- [Helm deployment config](https://github.com/akane-push/terraform-flight-predict/tree/main/terraform-k3s): `terraform-k3s`

### Other components

- **Operator**
- **OVH Cloud**
- **GitLab**
- **K3s cluster**

## Connections

- Operator → VM resources: runs Terraform (evidence: `README.md`)
- VM resources → OVH Cloud: provisions VMs (evidence: `README.md`)
- Operator → Host inventory: configures hosts (evidence: `README.md`)
- Host inventory → K3s setup: targets servers (evidence: `README.md`)
- Host inventory → Docker setup: targets runner (evidence: `README.md`)
- Host inventory → GitLab runners: registers runners (evidence: `README.md`)
- GitLab runners → GitLab: registers with (evidence: `README.md`)
- Operator → Helm deployment config: deploys charts (evidence: `README.md`)
- Helm deployment config → K3s cluster: deploys to (evidence: `README.md`)
