# Proxmox Deployment - Readiness Checklist

**Last Updated**: 2024-12-19  
**Status**: ✅ **READY FOR DEPLOYMENT**

## Pre-Deployment Checklist

### ✅ Credentials Configured

- [x] Cloudflare Global API Key added to `.env`
- [x] Cloudflare Email added to `.env`
- [x] Cloudflare Origin CA Key added to `.env`
- [ ] Cloudflare Zone ID (can be auto-detected)
- [ ] Cloudflare Account ID (can be auto-detected)
- [ ] Proxmox API tokens (to be created)

### ✅ Configuration Files

- [x] Provider configuration complete
- [x] Cloudflare tunnel configs complete
- [x] DNS configuration files ready
- [x] VM example manifests ready
- [x] All placeholders replaced

### ✅ Scripts Ready

- [x] 17 automation scripts complete
- [x] All scripts support `.env` loading
- [x] Validation scripts ready
- [x] Deployment scripts ready

### ✅ Documentation

- [x] 25+ documentation files complete
- [x] Quick start guide
- [x] Deployment guides
- [x] Development guides
- [x] Script reference

## Deployment Steps

### Step 1: Get Cloudflare Information

```bash
# Auto-detect Zone ID and Account ID
./scripts/get-cloudflare-info.sh
```

This will:
- Get Zone ID for `sankofa.nexus`
- Get Account ID
- Optionally update `.env` file

### Step 2: Setup DNS Records

```bash
# Create DNS records for Proxmox instances
./scripts/setup-dns-records.sh
```

This will create:
- A records: `ml110-01.sankofa.nexus`, `r630-01.sankofa.nexus`
- CNAME records: `*-api.sankofa.nexus`, `*-metrics.sankofa.nexus`

### Step 3: Create Proxmox API Tokens

For each Proxmox instance:

1. Log in to Proxmox web UI
2. Go to: Datacenter → Permissions → API Tokens
3. Create token:
   - Token ID: `crossplane-<site-name>`
   - User: `root@pam` (or dedicated service account)
   - Permissions: Administrator (or specific VM permissions)
4. Save token secret securely

### Step 4: Create Kubernetes Secret

```bash
# Interactive secret creation
./scripts/create-proxmox-secret.sh
```

This will:
- Prompt for credentials
- Create Kubernetes secret in `crossplane-system` namespace

### Step 5: Deploy Crossplane Provider

```bash
# Build and deploy provider
./scripts/deploy-crossplane-provider.sh
```

Or skip build:
```bash
BUILD_PROVIDER=false ./scripts/deploy-crossplane-provider.sh
```

### Step 6: Apply ProviderConfig

```bash
# Apply provider configuration
kubectl apply -f crossplane-provider-proxmox/examples/provider-config.yaml
```

### Step 7: Verify Deployment

```bash
# Verify provider is running
./scripts/verify-provider-deployment.sh
```

### Step 8: Deploy Test VMs

```bash
# Deploy test VMs to both instances
./scripts/deploy-test-vms.sh
```

### Step 9: Setup Monitoring

```bash
# Configure Prometheus and Grafana
./scripts/setup-monitoring.sh
```

### Step 10: Setup Proxmox Agents

On each Proxmox node:

```bash
SITE=us-sfvalley NODE=ML110-01 ./scripts/setup-proxmox-agents.sh
```

## Quick Deployment

For automated deployment:

```bash
./scripts/quick-deploy.sh
```

## Verification Commands

### Check Provider Status

```bash
kubectl get pods -n crossplane-system
kubectl logs -n crossplane-system -l app=crossplane-provider-proxmox
```

### Check VM Status

```bash
kubectl get proxmoxvm
kubectl describe proxmoxvm <vm-name>
```

### Check DNS Resolution

```bash
dig ml110-01.sankofa.nexus
dig r630-01.sankofa.nexus
```

### Test Proxmox Connectivity

```bash
export PROXMOX_TOKEN='user@realm!token-id=token-secret'
./scripts/test-proxmox-connectivity.sh
```

## Troubleshooting

### DNS Not Resolving

1. Check Cloudflare dashboard
2. Verify Zone ID is correct
3. Check DNS records exist
4. Wait for DNS propagation (up to 5 minutes)

### Provider Not Starting

1. Check provider logs
2. Verify ProviderConfig is correct
3. Check credentials secret exists
4. Verify CRDs are installed

### VM Creation Failing

1. Check VM resource status
2. Review provider logs
3. Verify Proxmox API access
4. Check node names match

## Next Steps After Deployment

1. **Production VMs**: Create production VM manifests
2. **Backups**: Configure automated backups
3. **Monitoring**: Set up alerts
4. **Security**: Review and harden configuration
5. **Documentation**: Update with actual values

## Related Documentation

- [Quick Start Guide](./QUICK_START.md)
- [Deployment Guide](./DEPLOYMENT_GUIDE.md)
- [Script Reference](./SCRIPT_REFERENCE.md)
- [Environment Variables](./ENVIRONMENT_VARIABLES.md)

