### Summary of Changes - **Added `ermnvldmr` Platform Documentation (English & Russian)**: - `_index.md`: Overview and navigation cards - `architecture.md`: End-to-end architecture (Packer, Cloud-Init, K3s, Flux v2, Cloudflare) with Mermaid diagram - `golden-image.md`: Packer QEMU build pipeline, S3 storage & quota pruning - `deployment-gitops.md`: Declarative Flux GitOps, release pipelines, fast-track deploys, and automated `/version.json` rollout validation - `operations.md`: SSH access, SOPS + Age secret encryption, PostgreSQL storage, S3 backups, and Cloudflare configuration - **Deprecated Section Cleanup**: - Deleted obsolete `services/docs/content/en/root/` and `services/docs/content/ru/root/`
3.5 KiB
3.5 KiB
title, weight, type
| title | weight | type |
|---|---|---|
| Golden Image Automation | 3 | docs |
The ermnvldmr.com golden image pipeline automates the generation of standardized, hardened Debian 12 virtual machine images pre-configured for single-node K3s clustering.
1. Packer Configuration & Provisioning Pipeline
Golden images are defined in ci/packer/ and built using the qemu Packer builder.
Key Files:
debian-12-k3s.pkr.hcl: Main Packer template specifying CPU, RAM, disk size (10GB qcow2), Debian 12 Netinst ISO, boot commands, and provisioner sequence.http/preseed.cfg: Debian automated preseed installation rules (minimal system, non-interactive partitioning, APT mirrors).scripts/01-base-system.sh: Base system package installation, cloud-init forced policy enablement (/etc/cloud/ds-identify.cfg), kernel optimization, and fail2ban setup.scripts/02-install-k3s.sh: Downloads and installs the K3s binary (INSTALL_K3S_SKIP_ENABLE=true,INSTALL_K3S_SKIP_START=true) so the binary is baked into/usr/local/bin/k3swithout creating a cluster during image build.scripts/03-cleanup.sh: Machine identity reset (/etc/machine-id,/var/lib/dbus/machine-id,/etc/ssh/ssh_host_*), cache purging, and zeroing free space for maximum image compression.
2. GitHub Actions Automation
The image build is executed via .github/workflows/ci-next-build-golden-image.yml.
Workflow Stages:
- Validate Provisioner Scripts: Verifies bash syntax (
bash -n ci/packer/scripts/*.sh) and Packer template formatting (packer fmt -check). - Build Golden Image:
- Initializes Packer plugins (
packer init). - Runs headless QEMU virtual machine build (
packer build). - Compresses the output artifact to
qcow2.
- Initializes Packer plugins (
- S3 Storage Upload & Quota Management:
- Configures AWS S3 CLI with S3-compatible Object Storage credentials.
- Automatic Quota Pruning: Removes older images matching
dev/images/com-ermnvldmr-debian-12-k3s-amd64-*.qcow2before uploading to prevent exceeding bucket limits. - Uploads: The newly baked image is pushed to:
s3://<bucket>/dev/images/com-ermnvldmr-debian-12-k3s-amd64-<git_short_sha>.qcow2
3. Naming Convention
Images follow a deterministic naming structure based on the git commit:
com-ermnvldmr-debian-12-k3s-amd64-<short_sha>.qcow2
Example: com-ermnvldmr-debian-12-k3s-amd64-f4ba6d1.qcow2
4. First-Boot Cloud-Init Integration
When launching a compute instance from the uploaded golden image in your cloud infrastructure:
- Pass the instantiated
user-data.template.yamlin the instance metadata underuser-data. - Cloud-init executes
/usr/local/bin/bootstrap-cluster.shautonomously on first boot. - The instance initializes the network, formats persistent SSDs, starts K3s, installs Flux, and syncs production workloads within ~90 seconds.