deploy

Deploy k3s and Docker services via Ansible with locking, dry-run validation, and health verification.

2|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/DanielH2018/server --skill deploy-danielh2018
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deploy
Source: https://github.com/DanielH2018/server/tree/main/.claude/skills/deploy
Command: npx skills add https://github.com/DanielH2018/server --skill deploy-danielh2018

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying services to a k3s homelab by hand risks racing GitOps deploys, applying stale or uncommitted manifests, and mistaking a green playbook run for a healthy workload. This Skill enforces the correct deploy path — locks, snapshot worktrees, dry-run validation, and post-deploy health gates — for both k3s workloads and the Pi's Docker services. ## Core Features & Use Cases - Platform-aware deployment: Routes services to the right path — k3s roles under ansible/roles/k8s/ or Docker roles on daniel-pi — and never runs Docker verification on cluster nodes where Docker no longer exists. - Three validation modes: Distinguishes prek (local schema checks), --check (task wiring only), and --dry-run (server-side validation against the live API server, including CRDs), so the right check answers the right question. - Locked, snapshot-based deploys: Runs through scripts/deploy.sh, which holds the shared git-tree lock, deploys from a snapshot of HEAD, and serializes per-service deploys; exit codes 2–77 distinguish "nothing deployed" resume points from real playbook failures. - Health verification gate: Confirms rollouts with probe.py health, which requires a fully complete rollout and no container restarts in the last 180 seconds — catching crashloops that kubectl rollout status reports as green. - Use Case: After merging a PR that changes a Traefik middleware, deploy the affected service with a server-side dry run first, then deploy and verify the rollout is healthy before declaring success. ## Quick Start Ask the assistant to deploy a specific service by name, for example requesting a dry run first and then a verified deploy of the service through the Ansible deploy wrapper.

Frequently Asked Questions about deploy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a single service with Ansible in this homelab?▼

Run ./scripts/deploy.sh --tags "<service-name>" from /home/ubuntu/server. The wrapper takes the shared git-tree lock, snapshots HEAD into a worktree, and runs the playbook under a per-service lock. Add -e target=daniel-pi for Pi Docker services.

What is the difference between prek, --check, and --dry-run for k8s manifests?▼

prek renders and schema-checks manifests locally without an API server. --check skips the apply entirely and only validates task wiring. --dry-run applies with kubectl --dry-run=server, so the live API server validates CRDs, ordering, and admission rules.

Why does deploy.sh exit with code 75 or 4?▼

Exit 75 means a lock stayed busy and nothing was deployed — retry later. Exit 4 means the tree is behind origin/master; run git pull rather than bypassing the staleness check, since a stale tree renders stale templates.

Can I verify a deploy with docker ps on the k3s nodes?▼

No. Docker was uninstalled from daniel-box and daniel-server, so docker commands do not exist there. Verify k3s workloads with probe.py health <service>, which checks rollout completion and recent container restarts; use --docker only for the Pi.

Why did my Ansible deploy succeed but the service is down?▼

Ansible reporting ok only means the playbook ran, not that the workload is healthy. A manifest can apply cleanly and then crash-loop or fail probes. Run probe.py health, then inspect with kubectl rollout status, describe pod, and logs.

What are the limitations of kubectl server-side dry run here?▼

Dry run refuses roles listed in k8s_dry_run_unsupported that mutate outside the manifests tree, and it cannot verify scheduling, PVC binding, probes, or rollout behavior. A brand-new service is only half-checked because volume-claim is skipped.