# 🚀 GitOps Deployment Guide

*Comprehensive guide for deploying services using GitOps methodology with Portainer*

## 📋 Overview

This guide covers the GitOps deployment process used in Vish's homelab, utilizing Portainer Enterprise Edition for automated container orchestration and deployment.

## 🔗 Quick Links

- **Main Documentation**: [GitOps Comprehensive Guide](docs/admin/GITOPS_COMPREHENSIVE_GUIDE.md)
- **Portainer API Guide**: [Portainer API Management](docs/admin/PORTAINER_API_GUIDE.md)
- **Infrastructure Overview**: [Infrastructure Documentation](docs/infrastructure/INFRASTRUCTURE_OVERVIEW.md)

## 🎯 GitOps Workflow

### 1. Repository Structure
```
homelab/
├── hosts/                    # Host-specific configurations
│   ├── synology/            # Synology NAS (atlantis, calypso)
│   ├── vms/                 # Virtual machines
│   ├── physical/            # Physical servers
│   └── edge/                # Edge devices
├── docs/                    # Documentation
└── scripts/                 # Automation scripts
```

### 2. Deployment Process

1. **Update Configuration**: Modify compose files in the appropriate host directory
2. **Commit Changes**: Push changes to the main branch
3. **Automatic Deployment**: Portainer detects changes and redeploys services
4. **Verification**: Monitor deployment status via Portainer dashboard

## 🐳 Portainer Integration

### Current Setup
- **URL**: https://192.168.0.200:9443
- **Version**: 2.33.7 (Enterprise Edition)
- **Active Stacks**: GitOps-managed deployments
- **Repository**: https://git.vish.gg/Vish/homelab.git

### Stack Management
- Stacks are automatically synchronized with Git repository
- Changes trigger immediate redeployment
- Full rollback capability through Git history

## 📊 Monitoring & Validation

### Health Checks
- Container status monitoring
- Service availability verification
- Resource usage tracking

### Troubleshooting
- Check Portainer logs for deployment issues
- Verify compose file syntax
- Monitor container health status

## 🔧 Common Operations

### Adding New Service
1. Create compose file in appropriate host directory
2. Commit and push to repository
3. Verify deployment in Portainer
4. Update documentation

### Updating Existing Service
1. Modify existing compose file
2. Test configuration locally if possible
3. Commit changes
4. Monitor deployment progress

## 📚 Additional Resources

- [Operational Status](OPERATIONAL_STATUS.md) - Current deployment status
- [Monitoring Architecture](MONITORING_ARCHITECTURE.md) - Monitoring setup
- [Infrastructure Health](docs/infrastructure/INFRASTRUCTURE_HEALTH_REPORT.md) - System status

---

**Last Updated**: February 24, 2026  
**Status**: ✅ Active GitOps deployment system  
**Managed Services**: 50+ containers across multiple hosts