Skip to content

Commit cfbe8a1

Browse files
committed
docs: refresh infra docs for post-Hetzner architecture
Closes #55. Brings docs/ in line with the post-July-2024 architecture (single Hetzner VM running Caddy + Sinatra/Puma API server + Prometheus, provisioned by Ansible), replacing references to the previous GKE Autopilot + Nginx Ingress + Cloud Run apiserver setup. Files changed: - docs/infrastructure-overview.md — rewritten section by section. Every claim is grounded in current IaC. The two GCP-service-account sections are folded into a single "CI/CD authentication" section that splits per-caller: server-edition uses GCP WIF (APT/YUM repo buckets + GCS CI artifacts bucket) and Azure Federated Identity Credentials (Azure Blob CI artifacts + CI cache + Key Vault GPG key); infra repo's apiserver workflow only mints a GitHub OIDC JWT (audience backend.fullstaqruby.org) and POSTs to /admin/upgrade_apiserver — it does not authenticate to GCP or Azure APIs. The Caddy section is corrected: there is no backend.fullstaqruby.org vhost; both apt. and yum. vhosts handle /admin/* via reverse_proxy to the apiserver Unix socket. The "Google Cloud projects" claim of two projects is corrected — there is one project, fsruby-server-edition2, provisioned by terraform-hisec/gcloud_project.tf and populated by terraform/; the hisec/non-hisec separation lives at the Terraform-state and access-group layer. Container registry section dropped (no registry resources are managed in this repo). Key Vault name uses the templated form ${var.key_vault_prefix}infraowners (currently fsruby2infraowners). CI artifacts/cache split is now explicit (artifacts dual-cloud, cache Azure-only). VM section distinguishes Terraform-managed forward DNS from the manually-set Hetzner PTR record. - docs/infrastructure-overview.drawio.svg — deleted. Replaced by an inline Mermaid diagram in infrastructure-overview.md so future diagram changes are reviewable as text diffs. - docs/editing-diagrams.md — deleted (no longer needed without the drawio round-trip). - docs/deploy.md — replaces the gcloud-clusters/kubectl steps with a single ansible-playbook step matching bootstrapping Step 11. Adds a callout that apiserver code changes deploy via the GitHub Actions workflow. - docs/infrastructure-as-code.md — drops Kustomize and the kubernetes/ directory bullet; adds Ansible to the tool list and an ansible/ directory bullet. - docs/infrastructure-bootstrapping.md — intro updated to mention Terraform + Ansible (not Kubernetes/Kustomize); the rest of the file already reflected the post-migration setup. - docs/pull_request_template.md — diagram-update checkbox now points to the Mermaid block instead of the deleted drawio file. - README.md — drops the link to the deleted editing-diagrams.md. - .editorconfig — removes the duplicate [config.ru] block (the tab/4 one); only the correct space/2 rule remains. Note: the "Github CI bot account" section is kept as-is. Retiring that PAT-based bot is already tracked in #18 and is therefore out of scope here.
1 parent e0d881a commit cfbe8a1

9 files changed

Lines changed: 117 additions & 1943 deletions

.editorconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ indent_size = 2
1616
indent_style = space
1717
indent_size = 2
1818

19-
[config.ru]
20-
indent_style = tab
21-
indent_size = 4
22-
2319
[*.rb]
2420
indent_style = space
2521
indent_size = 2

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Concepts:
1616
Tasks:
1717

1818
* [Deployment guide](docs/deploy.md)
19-
* [Editing diagrams](docs/editing-diagrams.md)
2019

2120
Organizational (for team members):
2221

docs/deploy.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,12 @@ This guide explains how to deploy infrastructure updates. This guide is not for
5656
cd ..
5757
~~~
5858

59-
4. Get the credentials for the Kubernetes cluster:
59+
4. Apply Ansible to the backend VM:
6060

6161
~~~bash
62-
gcloud container clusters get-credentials fullstaq-ruby-autopilot --configuration fullstaq-ruby --region us-east4
62+
cd ansible
63+
ansible-playbook -i hosts.ini -v main.yml
64+
cd ..
6365
~~~
6466

65-
5. Set the default namespace:
66-
67-
~~~bash
68-
kubectl config set-context --current --namespace=fullstaq-ruby
69-
~~~
70-
71-
6. Apply the Kustomization:
72-
73-
~~~bash
74-
kubectl apply --context=gke_fullstaq-ruby_us-east4_fullstaq-ruby-autopilot -k ../kubernetes
75-
~~~
67+
> The API server itself is not deployed by this playbook. Code changes under `apiserver/` are released by the `.github/workflows/apiserver.yml` workflow, which packages a tarball, attaches it to a GitHub Release, and triggers `POST /admin/upgrade_apiserver` on the live host.

docs/editing-diagrams.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/infrastructure-as-code.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
We define as much infrastructure as possible in the form of code, using:
44

55
* [Terraform](https://terraform.io)
6-
* Kubernetes YAML, managed with [Kustomize](https://kustomize.io/)
6+
* [Ansible](https://www.ansible.com/)
77
* Github Actions
88

99
The infrastructure-as-code is stored in the following directories:
1010

11-
* `terraform/` — Infrastructure administered by [Infra Maintainers](roles.md), except for resources inside Kubernetes. Most of the infrastructure is defined here.
11+
* `terraform/` — Infrastructure administered by [Infra Maintainers](roles.md). Most of the cloud-side infrastructure is defined here.
1212

13-
* `terraform-hisec/` — Infrastructure administered by [Infra Owners](roles.md). This covers for example resources in the `fullstaq-ruby-hisec` Google Cloud project.
13+
* `terraform-hisec/` — Infrastructure administered by [Infra Owners](roles.md). This covers for example sensitive resources such as the GPG signing key in Azure Key Vault, and the high-security Terraform state backend.
1414

15-
Because we don't expect the infrastructure in this directory to change very often, we've chosen — for security reasons — not to run Terraform in a CI/CD pipeline. This way we don't have to worry about the security of the CI/CD pipeline's service account. Instead, an [Infra Owner](roles.md) runs Terraform manually, using that person's personal Google Cloud credentials.
15+
Because we don't expect the infrastructure in this directory to change very often, we've chosen — for security reasons — not to run Terraform in a CI/CD pipeline. This way we don't have to worry about the security of any CI/CD pipeline credentials. Instead, an [Infra Owner](roles.md) runs Terraform manually, using their personal cloud credentials.
1616

17-
* `kubernetes/`Kubernetes resources administered by [Infra Maintainers](roles.md).
17+
* `ansible/`Configuration of the backend VM (Caddy, the API server, Prometheus, and OS hardening). Administered by [Infra Maintainers](roles.md) and applied manually; see [Deployment guide](deploy.md).
1818

19-
* `.github/workflows/apiserver.yml`Deploys the API server.
19+
* `.github/workflows/apiserver.yml`Builds and deploys the API server.
2020

2121
Note that not all infrastructure can, or (for security reasons) should, be managed via code. Learn more at [Infrastructure bootstrapping](infrastructure-bootstrapping.md).

docs/infrastructure-bootstrapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Infrastructure bootstrapping
22

3-
We try to codify infrastructure as much as possible using Terraform and Kubernetes YAML. However:
3+
We try to codify infrastructure as much as possible using Terraform and Ansible. However:
44

55
- Not everything _can_ be automated. For example, we need to setup Azure Blob Storage for storing Terraform state, before we can use Terraform.
66
- Not everything _should_ be automated. For example, the `fullstaq-ruby-hisec` project contains such sensitive data, that giving access to CI/CD systems would pose a security risk.

0 commit comments

Comments
 (0)