Loading...
Loading...
Use when managing an Uncloud cluster — deploying services, configuring Caddy ingress, adding static proxy routes for non-cluster devices, publishing ports, scaling, inspecting logs, or managing machines and volumes with the `uc` CLI.
npx skill4agent add affaan-m/everything-claude-code unclouducuc machineuc deployx-caddyx-ports--caddyfileucuc machine init user@host --name machine-1
uc service run --name web -p app.example.com:8080/https nginx:latest
uc deploy10.210.0.0/16x-caddy--caddyfile| Command | Purpose |
|---|---|
| Bootstrap first machine / new cluster |
| Join machine to existing cluster |
| List machines |
| Update public IP for ingress |
| Remove machine |
init--name--network 10.210.0.0/16--no-caddy--no-dns--public-ip auto\|IP\|none| Command | Purpose |
|---|---|
| List services |
| Run a single container service |
| Deploy from |
| Deploy already-pushed images without rebuilding |
| Force service recreation |
| Set replica count |
| View logs |
| Shell into container |
| Detailed info |
| Remove service (keeps named volumes) |
| All containers across cluster |
uc image push myapp:latest # Push local image to all machines
uc image push myapp:latest -m machine1,machine2 # Push to specific machines
uc images # List images in clusteruc volume ls # All volumes
uc volume ls -m machine1 # On specific machine
uc volume create NAME -m MACHINE
uc volume rm NAMEuc caddy config # Show current generated Caddyfile (read-only)
uc caddy deploy # Deploy/upgrade Caddy across clusteruc dns show # Show reserved *.uncld.dev domain
uc dns reserve # Reserve a new domain
uc ctx ls # List cluster contexts
uc ctx use prod # Switch context-p [hostname:]container_port[/protocol]| Example | Meaning |
|---|---|
| HTTPS with auto |
| HTTPS with custom hostname |
| HTTP only, no TLS |
-p [host_ip:]host_port:container_port[/protocol]@host| Example | Meaning |
|---|---|
| TCP 5432 on all interfaces |
| TCP 5432 loopback only |
| UDP |
x-portsservices:
app:
image: app:latest
x-ports:
- example.com:8000/https
- www.example.com:8000/https
- api.example.com:9000/httpsx-caddyservices:
app:
image: app:latest
x-caddy: |
example.com {
redir https://www.example.com{uri} permanent
}
www.example.com {
reverse_proxy {{upstreams 8000}} {
import common_proxy
}
basic_auth /admin/* {
admin $2a$14$...
}
}x-caddy{{upstreams [service] [port]}}{{.Name}}{{.Upstreams}}x-machinesservices:
db:
image: postgres:18
x-machines: db-machine # Single machine name
app:
image: app:latest
x-machines:
- machine-1
- machine-2services:
api:
build: ./api
x-ports:
- api.example.com:3000/https
environment:
DATABASE_URL: postgres://db:5432/mydb
web:
build: ./web
x-ports:
- example.com:8000/https
- www.example.com:8000/https
environment:
API_URL: http://api:3000
db:
image: postgres:18
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- db-data:/var/lib/postgresql/data
x-machines: db-machine
volumes:
db-data:~/device.caddyfilehttps://device.example.com {
reverse_proxy https://192.168.1.x {
transport http {
tls_insecure_skip_verify # needed for self-signed BMC certs
}
}
log
}reverse_proxy http://192.168.1.x:portuc service run \
--name device-bmc \
--caddyfile ~/device.caddyfile \
registry.k8s.io/pause:3.9pauseuc caddy config # device.example.com block should appearcannot be combined with non---caddyfilepublished ports.@host
*.yourdomain.com → cluster-public-ip| DNS name | Resolves to |
|---|---|
| Any healthy container |
| Same |
| Round-robin |
| Machine-local first |
uc scale web 5 # 5 replicas (spread across machines)
uc scale web 1 # Scale downservices:
caddy:
deploy:
mode: global # One container on every machineimage: myapp:{{gitdate "20060102"}}.{{gitsha 7}}
image: myapp:{{gitsha 7}}.${GITHUB_RUN_ID:-local}| Function | Output |
|---|---|
| First N chars of commit SHA |
| Git commit date in Go format |
| Current date |
uc deploy # Build + push + deploy
uc build --push && uc deploy --no-build # Separate stepsuc inspect web
uc logs -f web
uc logs --since 1h web
uc exec web # Opens shell
uc exec web /bin/sh -c "env" # Run specific commanduc deploy --recreate| Mistake | Fix |
|---|---|
| Editing the Caddyfile directly | Use |
| Proxying an HTTPS upstream with self-signed cert | Add |
| Caddy admin socket unreachable — check |
| Service can't reach external LAN IP from container | Verify Caddy container's host can route to target network |
Volumes lost after | Named volumes persist; only anonymous volumes are auto-removed |