# Proxmox Deployment Checklist

**Last Updated**: 2024-12-19  
**Status**: Configuration Complete - Ready for Deployment

## Pre-Deployment Checklist

### ✅ Completed (Can be done without access)

- [x] **Code Implementation**
  - [x] Proxmox API client complete
  - [x] HTTP client with authentication
  - [x] Metrics collector implemented
  - [x] All CRD definitions ready

- [x] **Configuration**
  - [x] Provider configuration files ready
  - [x] Cloudflare tunnel configs ready
  - [x] DNS configuration files ready
  - [x] All placeholders replaced
  - [x] Node names updated (ML110-01, R630-01)
  - [x] FQDNs configured (sankofa.nexus)

- [x] **Documentation**
  - [x] Deployment guides complete
  - [x] Runbooks created
  - [x] Security documentation
  - [x] Troubleshooting guides
  - [x] DNS configuration guide

- [x] **Scripts & Automation**
  - [x] DNS setup script
  - [x] Secret creation script
  - [x] Provider verification script
  - [x] Connectivity test script
  - [x] Resource discovery script

## Deployment Checklist (Requires Access)

### Phase 1: DNS Configuration

- [ ] **Configure DNS Records** (TASK-029)
  - [ ] Get Cloudflare zone ID for sankofa.nexus
  - [ ] Run: `./scripts/setup-dns-records.sh`
  - [ ] Or configure manually via Cloudflare dashboard
  - [ ] Verify DNS resolution: `dig ml110-01.sankofa.nexus`
  - [ ] Verify DNS resolution: `dig r630-01.sankofa.nexus`

### Phase 2: Proxmox Authentication

- [ ] **Create API Tokens** (TASK-003, TASK-004)
  - [ ] Log into ML110-01 Proxmox UI
  - [ ] Create API token: `crossplane-ml110-01`
  - [ ] Log into R630-01 Proxmox UI
  - [ ] Create API token: `crossplane-r630-01`
  - [ ] Test authentication: `./scripts/test-proxmox-connectivity.sh`

### Phase 3: Kubernetes Setup

- [ ] **Install Go** (if not installed)
  ```bash
  # Ubuntu/Debian
  sudo apt install golang-go
  
  # Or download from https://go.dev/dl/
  ```

- [ ] **Build Provider** (TASK-009)
  ```bash
  cd crossplane-provider-proxmox
  make build
  make test
  ```

- [ ] **Deploy to Kubernetes** (TASK-010)
  ```bash
  # Apply CRDs
  kubectl apply -f crossplane-provider-proxmox/config/crd/bases/
  
  # Deploy provider
  kubectl apply -f crossplane-provider-proxmox/config/provider.yaml
  
  # Verify
  kubectl get pods -n crossplane-system
  ```

- [ ] **Create Credentials Secret** (TASK-011)
  ```bash
  # Use automated script
  ./scripts/create-proxmox-secret.sh
  
  # Or manually
  kubectl create secret generic proxmox-credentials \
    --from-literal=credentials.json='{"username":"root@pam","token":"..."}' \
    -n crossplane-system
  ```

- [ ] **Apply ProviderConfig** (TASK-011)
  ```bash
  kubectl apply -f crossplane-provider-proxmox/examples/provider-config.yaml
  
  # Verify
  ./scripts/verify-provider-deployment.sh
  ```

### Phase 4: Infrastructure Setup

- [ ] **Deploy Prometheus Exporters** (TASK-012)
  ```bash
  # On ML110-01
  SITE=us-sfvalley NODE=ML110-01 ./scripts/setup-proxmox-agents.sh
  
  # On R630-01
  SITE=us-sfvalley-2 NODE=R630-01 ./scripts/setup-proxmox-agents.sh
  ```

- [ ] **Configure Cloudflare Tunnels** (TASK-013)
  - [ ] Generate tunnel credentials via Cloudflare dashboard
  - [ ] Deploy tunnel configs to nodes
  - [ ] Start tunnel services
  - [ ] Verify tunnel connectivity

- [ ] **Set Up Monitoring** (TASK-014)
  - [ ] Import Grafana dashboards
  - [ ] Configure Prometheus data source
  - [ ] Set up alerts
  - [ ] Verify metrics collection

### Phase 5: Testing

- [ ] **Deploy Test VMs** (TASK-015)
  ```bash
  # Instance 1
  kubectl apply -f crossplane-provider-proxmox/examples/test-vm-instance-1.yaml
  
  # Instance 2
  kubectl apply -f crossplane-provider-proxmox/examples/test-vm-instance-2.yaml
  
  # Verify
  kubectl get proxmoxvm
  ```

- [ ] **End-to-End Testing** (TASK-016)
  - [ ] Test VM creation from portal
  - [ ] Test VM lifecycle operations
  - [ ] Test multi-site deployments
  - [ ] Test error handling

- [ ] **Performance Testing** (TASK-017)
  - [ ] Load test API endpoints
  - [ ] Test concurrent operations
  - [ ] Measure response times

## Quick Start Commands

### 1. Test Connectivity
```bash
./scripts/test-proxmox-connectivity.sh
```

### 2. Setup DNS
```bash
export CLOUDFLARE_ZONE_ID="your-zone-id"
export CLOUDFLARE_API_TOKEN="your-token"
./scripts/setup-dns-records.sh
```

### 3. Create Kubernetes Secret
```bash
./scripts/create-proxmox-secret.sh
```

### 4. Deploy Provider
```bash
cd crossplane-provider-proxmox
make build
kubectl apply -f config/crd/bases/
kubectl apply -f config/provider.yaml
kubectl apply -f examples/provider-config.yaml
```

### 5. Verify Deployment
```bash
./scripts/verify-provider-deployment.sh
```

## Current Status

- **Code**: ✅ 100% Complete
- **Configuration**: ✅ 100% Complete
- **Documentation**: ✅ 100% Complete
- **Scripts**: ✅ 100% Complete
- **Deployment**: ⏳ Pending Access

## Next Steps

1. **Get Cloudflare Access** → Configure DNS (TASK-029)
2. **Get Proxmox Credentials** → Test authentication (TASK-003, TASK-004)
3. **Set Up Kubernetes** → Deploy provider (TASK-009, TASK-010, TASK-011)
4. **Deploy Infrastructure** → Exporters, tunnels, monitoring (TASK-012, TASK-013, TASK-014)
5. **Test Everything** → VMs, E2E, performance (TASK-015, TASK-016, TASK-017)

## Related Documentation

- [Deployment Guide](./DEPLOYMENT_GUIDE.md)
- [DNS Configuration](./DNS_CONFIGURATION.md)
- [Site Mapping](./SITE_MAPPING.md)
- [Task List](./TASK_LIST.md)

