Host Deployment Runbook
PiVirt deployment operations encompass single-node development setup, multi-node control plane bootstrap, automated node joins, and zero-downtime rolling upgrades.
Cluster Bootstrap
Section titled “Cluster Bootstrap”Single Node
Section titled “Single Node”# Initialize clusterpvcli cluster init --name dev-cluster
# Verifypvcli cluster get dev-clusterMulti-Node
Section titled “Multi-Node”# Initialize control planepvcli cluster init --name prod-cluster --control-plane 3
# Generate join tokenpvcli cluster token create --ttl 24h
# Join worker nodespvcli cluster join --token <token> --node-ip 10.0.1.20Node Management
Section titled “Node Management”Add Nodes
Section titled “Add Nodes”# Add worker nodespvcli cluster node add --role worker --count 3
# Add specific nodepvcli cluster node add --name worker-04 --ip 10.0.1.24Remove Nodes
Section titled “Remove Nodes”# Drain node firstpvcli cluster node drain worker-03
# Remove nodepvcli cluster node remove worker-03Maintenance
Section titled “Maintenance”# Cordon node (no new VMs)pvcli cluster node cordon worker-01
# Drain node (evict VMs)pvcli cluster node drain worker-01
# Uncordon after maintenancepvcli cluster node uncordon worker-01Rolling Updates
Section titled “Rolling Updates”Update PiVirt Components
Section titled “Update PiVirt Components”# Check current versionpvcli cluster get prod-cluster -o json | jq '.version'
# Update to new versionpvcli cluster upgrade --version v0.0.90 --strategy rolling
# Monitor progresspvcli cluster upgrade statusUpdate Strategy
Section titled “Update Strategy”apiVersion: pivirt.pilab.hu/v1kind: ClusterUpgrademetadata: name: upgrade-v0.0.90spec: version: "v0.0.90" strategy: type: "rolling" max_surge: 1 max_unavailable: 0 partition: 0Backup & Restore
Section titled “Backup & Restore”Backup Cluster State
Section titled “Backup Cluster State”# Backup etcdpvcli cluster backup create --name backup-2024-01-15
# List backupspvcli cluster backup listRestore from Backup
Section titled “Restore from Backup”# Restore clusterpvcli cluster backup restore --name backup-2024-01-15Troubleshooting
Section titled “Troubleshooting”Cluster Health
Section titled “Cluster Health”# Check cluster statuspvcli cluster get prod-cluster -o yaml
# Check node statuspvcli cluster node list
# Check component healthpvcli cluster healthCommon Issues
Section titled “Common Issues”| Issue | Resolution |
|---|---|
| Node not joining | Check network connectivity, firewall rules |
| etcd quorum lost | Restore from backup, check node health |
| PiTrust certificate errors | Verify CA chain, check PiTrust CA server / operator |