{"id":34888494,"url":"https://github.com/jfreed-dev/turing-ansible-cluster","last_synced_at":"2026-01-13T20:53:06.270Z","repository":{"id":330985219,"uuid":"1122458751","full_name":"jfreed-dev/turing-ansible-cluster","owner":"jfreed-dev","description":"Infrastructure-as-code for K3s clusters on Turing Pi RK1 with NPU support. Terraform + Ansible.","archived":false,"fork":false,"pushed_at":"2026-01-12T05:18:05.000Z","size":210,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T15:28:11.674Z","etag":null,"topics":["ansible","arm64","armbian","armbian-install","homelab","infrastructure-as-code","k3s","kubernetes","npu","rk3588","rknn","rknpu2","terraform","turing-pi"],"latest_commit_sha":null,"homepage":"https://github.com/jfreed-dev/turing-ansible-cluster","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfreed-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T19:18:33.000Z","updated_at":"2026-01-12T05:18:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jfreed-dev/turing-ansible-cluster","commit_stats":null,"previous_names":["jfreed-dev/turing-ansible-cluster"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/jfreed-dev/turing-ansible-cluster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fturing-ansible-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fturing-ansible-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fturing-ansible-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fturing-ansible-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfreed-dev","download_url":"https://codeload.github.com/jfreed-dev/turing-ansible-cluster/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fturing-ansible-cluster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","arm64","armbian","armbian-install","homelab","infrastructure-as-code","k3s","kubernetes","npu","rk3588","rknn","rknpu2","terraform","turing-pi"],"created_at":"2025-12-26T04:25:44.735Z","updated_at":"2026-01-13T20:53:06.266Z","avatar_url":"https://github.com/jfreed-dev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Turing RK1 Ansible Cluster\n\n[![CI](https://github.com/jfreed-dev/turing-ansible-cluster/actions/workflows/ci.yml/badge.svg)](https://github.com/jfreed-dev/turing-ansible-cluster/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nInfrastructure-as-code for deploying K3s Kubernetes on Turing Pi RK1 hardware with NPU support.\n\n**[Architecture Documentation](docs/ARCHITECTURE.md)** - Visual diagrams for network topology, deployment pipeline, and component interactions.\n\n## Overview\n\nDeploy a 4-node K3s cluster on Turing Pi with:\n- **Armbian** with Rockchip BSP kernel (NPU support)\n- **Terraform** for BMC flashing via [terraform-provider-turingpi](https://github.com/jfreed-dev/terraform-provider-turingpi)\n- **Ansible** for K3s installation and addon deployment\n- **Networking** matching existing Talos cluster configuration\n\n## Node Configuration\n\n| Node | IP | Role | Hardware |\n|------|-----|------|----------|\n| node1 | 10.10.88.73 | Control Plane | RK1 (slot 1) + NVMe |\n| node2 | 10.10.88.74 | Worker | RK1 (slot 2) + NVMe |\n| node3 | 10.10.88.75 | Worker | RK1 (slot 3) + NVMe |\n| node4 | 10.10.88.76 | Worker | RK1 (slot 4) + NVMe |\n\n## Prerequisites\n\n- Terraform \u003e= 1.5\n- Ansible \u003e= 2.15\n- Turing Pi BMC access\n- Armbian image (see [Building Armbian](#building-armbian) or [download pre-built](https://armbian-builds.techki.to/turing-rk1/26.02.0-trunk/Armbian-unofficial_26.02.0-trunk_Turing-rk1_bookworm_vendor_6.1.115.img.xz))\n\n## Quick Start\n\n### 1. Setup Secrets\n\n```bash\ncd ansible\n./scripts/setup-secrets.sh\n# Edit secrets/server.yml to set passwords\n```\n\n### 2. Flash Armbian via BMC\n\n```bash\ncd terraform/environments/server\n\n# Set BMC credentials\nexport TURINGPI_USERNAME=root\nexport TURINGPI_PASSWORD=turing\nexport TURINGPI_ENDPOINT=https://10.10.88.70\n# WARNING: Only use TURINGPI_INSECURE in trusted networks (disables TLS verification)\nexport TURINGPI_INSECURE=true\n\n# Flash all nodes (WARNING: destructive!)\nterraform init\nterraform apply -var=\"flash_nodes=true\" -var=\"firmware_path=/path/to/armbian.img\"\n```\n\n### 3. Deploy K3s Cluster\n\n```bash\ncd ansible\nansible-playbook -i inventories/server/hosts.yml playbooks/site.yml\n```\n\n### 4. Setup NPU (Optional)\n\n```bash\nansible-playbook -i inventories/server/hosts.yml playbooks/npu-setup.yml\n```\n\n## Repository Structure\n\n```\nturing-ansible-cluster/\n├── terraform/\n│   ├── modules/bmc/              # BMC operations module\n│   └── environments/server/      # RK1 cluster config\n│\n├── ansible/\n│   ├── inventories/server/       # Node inventory\n│   ├── playbooks/\n│   │   ├── site.yml              # Full deployment\n│   │   ├── bootstrap.yml         # OS preparation\n│   │   ├── kubernetes.yml        # K3s installation\n│   │   ├── addons.yml            # Helm addons\n│   │   └── npu-setup.yml         # RKNN toolkit\n│   ├── roles/                    # Ansible roles\n│   ├── secrets/                  # Local secrets (gitignored)\n│   └── scripts/setup-secrets.sh  # Initialize secrets\n```\n\n## Cluster Configuration\n\nMatches existing Talos cluster:\n\n| Component | Value |\n|-----------|-------|\n| Pod CIDR | 10.244.0.0/16 |\n| Service CIDR | 10.96.0.0/12 |\n| Cluster DNS | 10.96.0.10 |\n| MetalLB Range | 10.10.88.80-89 |\n| Ingress IP | 10.10.88.80 |\n\n## Addons Deployed\n\n- **MetalLB** - L2 LoadBalancer\n- **NGINX Ingress** - Ingress controller\n- **Longhorn** - Distributed storage (NVMe on workers)\n- **Prometheus + Grafana** - Monitoring\n- **Portainer Agent** - Container management\n\n## Storage Optimization\n\nAll nodes with NVMe drives are automatically configured to use NVMe for both Longhorn and K3s container storage:\n\n| Path | Location | Purpose |\n|------|----------|---------|\n| `/var/lib/longhorn` | NVMe partition 2 | Longhorn distributed storage |\n| `/var/lib/rancher` | NVMe (symlink) | K3s container images and data |\n\n**Note:** Nodes are labeled with `node.longhorn.io/create-default-disk=true` during deployment to enable automatic Longhorn disk detection.\n\n## NPU Support\n\nRuntime-only RKNN installation for RK3588 NPU inference:\n\n| Component | Description |\n|-----------|-------------|\n| rknn-llm | LLM inference runtime with librknnrt.so |\n| rkllama | Flask-based LLM API server (systemd service) |\n| DeepSeek 1.5B | Pre-installed RKLLM model (~1.9GB) |\n| NPU Device | `/dev/dri/renderD129` (DRM subsystem) |\n| Driver | rknpu v0.9.8+ (vendor kernel) |\n\n### LLM API Service\n\nEach node runs rkllama as a systemd service on port 8080:\n\n```bash\n# Load model\ncurl -X POST http://10.10.88.73:8080/load_model \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model_name\": \"DeepSeek-R1-1.5B\"}'\n\n# Generate response\ncurl -X POST http://10.10.88.73:8080/generate \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}'\n```\n\n**Performance:** ~7-8 tokens/second per node\n\nSee **[docs/NPU-API.md](docs/NPU-API.md)** for full API documentation.\n\n### NPU Status\n\n```bash\ncat /sys/kernel/debug/rknpu/version  # Driver version\ncat /sys/kernel/debug/rknpu/load     # Core utilization\nsystemctl status rkllama             # Service status\n```\n\nRequires Armbian with Rockchip vendor kernel (6.1.x).\n\n\u003e **Note**: Dev tools (rknn-toolkit2, ezrknpu) are not installed by default.\n\u003e For model conversion, use a separate dev machine.\n\n## Building Armbian\n\nBuild custom Armbian images with NPU support using the [Armbian build framework](https://github.com/armbian/build):\n\n```bash\n# Clone build framework\ngit clone --depth=1 https://github.com/armbian/build ~/armbian-build\ncd ~/armbian-build\n\n# Build image with vendor kernel (required for NPU)\n./compile.sh build \\\n  BOARD=turing-rk1 \\\n  BRANCH=vendor \\\n  RELEASE=bookworm \\\n  BUILD_MINIMAL=no \\\n  BUILD_DESKTOP=no\n```\n\nOutput: `~/armbian-build/output/images/Armbian-*_Turing-rk1_bookworm_vendor_*.img`\n\nFor advanced options (custom packages, static IPs, SSH keys), see **[docs/ARMBIAN-BUILD.md](docs/ARMBIAN-BUILD.md)**.\n\n### Image Distribution\n\nPre-built images are hosted on Cloudflare R2 at [armbian-builds.techki.to](https://armbian-builds.techki.to):\n\n```bash\n# Download latest image\n./scripts/download-armbian-image.sh --latest\n\n# Prepare for specific node\n./scripts/prepare-armbian-image.sh Armbian-*.img 1\n\n# Flash to node\ntpi flash --node 1 --image-path Armbian-*.img\n```\n\nSee **[docs/ARMBIAN-BUILD.md#image-distribution](docs/ARMBIAN-BUILD.md#image-distribution)** for full usage.\n\n## Development\n\n### Local Testing\n\n```bash\n# Install dependencies\nmake install-deps\n\n# Run all checks (lint + syntax)\nmake test\n\n# Run individual checks\nmake lint\nmake syntax-check\n```\n\n### Releases\n\nUses semantic versioning with git tags:\n\n```bash\n# Create a release\nmake release VERSION=v1.0.0\n\n# Push the tag (triggers GitHub release)\ngit push origin v1.0.0\n```\n\n### CI/CD\n\nGitHub Actions runs on every push and PR:\n- **Ansible Lint** - Code quality checks (production profile)\n- **Syntax Check** - Validates all playbooks\n- **Terraform Validate** - Checks Terraform configuration\n\n## Related Repositories\n\n- [terraform-provider-turingpi](https://github.com/jfreed-dev/terraform-provider-turingpi) - Terraform BMC provider\n- [turing-rk1-cluster](https://github.com/jfreed-dev/turing-rk1-cluster) - Original Talos Linux cluster\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfreed-dev%2Fturing-ansible-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfreed-dev%2Fturing-ansible-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfreed-dev%2Fturing-ansible-cluster/lists"}