|
| 1 | +# eShopOnWeb Deployment Guide |
| 2 | + |
| 3 | +This guide provides an overview of the available deployment options for eShopOnWeb. |
| 4 | + |
| 5 | +## Available Deployment Options |
| 6 | + |
| 7 | +### 1. Kubernetes (Container Orchestration) |
| 8 | +- **Location**: `/deploy/k8s/` |
| 9 | +- **Use Case**: Production-grade container orchestration across multiple cloud providers |
| 10 | +- **Features**: |
| 11 | + - Multiple deployment manifests (Web, PublicAPI) |
| 12 | + - ConfigMaps and Secrets for configuration |
| 13 | + - Service definitions (LoadBalancer, ClusterIP) |
| 14 | + - Ingress configuration for external access |
| 15 | + - Kustomize support for environment-specific overrides |
| 16 | + - Support for AKS, EKS, GKE, and on-premises clusters |
| 17 | + |
| 18 | +**Quick Start**: |
| 19 | +```bash |
| 20 | +cd deploy/k8s |
| 21 | +kubectl apply -k . |
| 22 | +``` |
| 23 | + |
| 24 | +📖 [Full Kubernetes Documentation](k8s/README.md) |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +### 2. Terraform (Infrastructure as Code) |
| 29 | +- **Location**: `/deploy/terraform/` |
| 30 | +- **Use Case**: Automated infrastructure provisioning on Azure |
| 31 | +- **Features**: |
| 32 | + - Azure Kubernetes Service (AKS) cluster provisioning |
| 33 | + - Azure Container Registry (ACR) setup |
| 34 | + - Virtual Network and networking components |
| 35 | + - Storage Account provisioning |
| 36 | + - Modular design (aks, networking, storage) |
| 37 | + - Environment-specific configurations (dev, staging, production) |
| 38 | + |
| 39 | +**Quick Start**: |
| 40 | +```bash |
| 41 | +cd deploy/terraform |
| 42 | +terraform init |
| 43 | +terraform apply |
| 44 | +``` |
| 45 | + |
| 46 | +📖 [Full Terraform Documentation](terraform/README.md) |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +### 3. Azure Bicep (Azure-Specific IaC) |
| 51 | +- **Location**: `/infra/` |
| 52 | +- **Use Case**: Azure-specific infrastructure deployment |
| 53 | +- **Features**: |
| 54 | + - Azure App Service deployment |
| 55 | + - Azure Container Instances (ACI) |
| 56 | + - Azure SQL Database |
| 57 | + - Key Vault integration |
| 58 | + - Azure Developer CLI (azd) support |
| 59 | + |
| 60 | +**Quick Start**: |
| 61 | +```bash |
| 62 | +azd init |
| 63 | +azd up |
| 64 | +``` |
| 65 | + |
| 66 | +📖 See main [README.md](../README.md) for Bicep/azd documentation |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +### 4. Docker Compose (Local Development) |
| 71 | +- **Location**: Repository root (`docker-compose.yml`) |
| 72 | +- **Use Case**: Local development and testing |
| 73 | +- **Features**: |
| 74 | + - Multi-container setup (Web, PublicAPI, SQL Server) |
| 75 | + - Quick local environment setup |
| 76 | + - Easy debugging |
| 77 | + |
| 78 | +**Quick Start**: |
| 79 | +```bash |
| 80 | +docker-compose build |
| 81 | +docker-compose up |
| 82 | +``` |
| 83 | + |
| 84 | +📖 See main [README.md](../README.md) for Docker documentation |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Deployment Decision Matrix |
| 89 | + |
| 90 | +| Criteria | Kubernetes | Terraform | Bicep/azd | Docker Compose | |
| 91 | +|----------|-----------|-----------|-----------|----------------| |
| 92 | +| **Complexity** | Medium-High | Medium | Low-Medium | Low | |
| 93 | +| **Cloud Agnostic** | ✅ Yes | ⚠️ Azure-focused | ❌ Azure only | ✅ Yes | |
| 94 | +| **Production Ready** | ✅ Yes | ✅ Yes | ✅ Yes | ❌ Dev only | |
| 95 | +| **Auto-scaling** | ✅ Built-in | ✅ Via AKS | ✅ Via App Service | ❌ No | |
| 96 | +| **Best For** | Multi-cloud, K8s expertise | Azure infra automation | Quick Azure deploy | Local dev/test | |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Recommended Deployment Paths |
| 101 | + |
| 102 | +### Path 1: Quick Azure Deployment (Fastest) |
| 103 | +1. Use **azd** with Bicep templates |
| 104 | +2. Deploy to Azure App Service or ACI |
| 105 | +3. Best for: Demos, POCs, simple deployments |
| 106 | + |
| 107 | +### Path 2: Production Kubernetes (Most Flexible) |
| 108 | +1. Use **Terraform** to provision AKS cluster and infrastructure |
| 109 | +2. Use **Kubernetes manifests** to deploy applications |
| 110 | +3. Best for: Production workloads, multi-cloud, scaling needs |
| 111 | + |
| 112 | +### Path 3: Azure Kubernetes (Balanced) |
| 113 | +1. Use **Terraform** to provision complete Azure infrastructure |
| 114 | +2. Automatically connects AKS with ACR |
| 115 | +3. Deploy apps using **Kubernetes manifests** |
| 116 | +4. Best for: Azure-centric production deployments |
| 117 | + |
| 118 | +### Path 4: Local Development (Simplest) |
| 119 | +1. Use **Docker Compose** for local environment |
| 120 | +2. Fast iteration and debugging |
| 121 | +3. Best for: Development and testing |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Prerequisites by Deployment Type |
| 126 | + |
| 127 | +### Kubernetes Deployment |
| 128 | +- [ ] Kubernetes cluster (AKS, EKS, GKE, etc.) |
| 129 | +- [ ] `kubectl` CLI installed |
| 130 | +- [ ] Container registry access |
| 131 | +- [ ] Docker for building images |
| 132 | + |
| 133 | +### Terraform Deployment |
| 134 | +- [ ] Azure subscription |
| 135 | +- [ ] Terraform CLI (>= 1.0) |
| 136 | +- [ ] Azure CLI |
| 137 | +- [ ] Appropriate Azure permissions |
| 138 | + |
| 139 | +### Bicep/azd Deployment |
| 140 | +- [ ] Azure subscription |
| 141 | +- [ ] Azure Developer CLI (`azd`) |
| 142 | +- [ ] Azure CLI (optional) |
| 143 | + |
| 144 | +### Docker Compose |
| 145 | +- [ ] Docker Engine |
| 146 | +- [ ] Docker Compose |
| 147 | +- [ ] Sufficient local resources |
| 148 | + |
| 149 | +--- |
| 150 | + |
| 151 | +## Environment Configuration |
| 152 | + |
| 153 | +### Development |
| 154 | +- Lower resource allocation |
| 155 | +- In-memory database option |
| 156 | +- Single replica deployments |
| 157 | +- Basic SKU services |
| 158 | + |
| 159 | +### Staging |
| 160 | +- Production-like configuration |
| 161 | +- Persistent storage |
| 162 | +- Auto-scaling enabled |
| 163 | +- Standard SKU services |
| 164 | + |
| 165 | +### Production |
| 166 | +- High availability setup |
| 167 | +- Multi-replica deployments |
| 168 | +- Auto-scaling configured |
| 169 | +- Premium SKU services |
| 170 | +- Monitoring and logging |
| 171 | +- Backup and disaster recovery |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## Security Considerations |
| 176 | + |
| 177 | +### All Deployments |
| 178 | +- ✅ Use secrets management (Key Vault, K8s Secrets) |
| 179 | +- ✅ Never commit credentials to source control |
| 180 | +- ✅ Use managed identities where possible |
| 181 | +- ✅ Enable HTTPS/TLS |
| 182 | +- ✅ Implement network policies |
| 183 | +- ✅ Regular security updates |
| 184 | + |
| 185 | +### Kubernetes Specific |
| 186 | +- Use Network Policies |
| 187 | +- Implement Pod Security Standards |
| 188 | +- Use RBAC for access control |
| 189 | +- Scan container images |
| 190 | +- Use private container registries |
| 191 | + |
| 192 | +### Terraform Specific |
| 193 | +- Use remote state with encryption |
| 194 | +- Implement state locking |
| 195 | +- Use workspaces for environments |
| 196 | +- Validate configurations before apply |
| 197 | + |
| 198 | +--- |
| 199 | + |
| 200 | +## Monitoring and Observability |
| 201 | + |
| 202 | +### Kubernetes |
| 203 | +- Prometheus + Grafana |
| 204 | +- Azure Monitor for AKS |
| 205 | +- Application Insights |
| 206 | +- Kubernetes Dashboard |
| 207 | + |
| 208 | +### Azure (Bicep/Terraform) |
| 209 | +- Azure Monitor |
| 210 | +- Application Insights |
| 211 | +- Log Analytics |
| 212 | +- Azure Advisor |
| 213 | + |
| 214 | +--- |
| 215 | + |
| 216 | +## Cost Optimization |
| 217 | + |
| 218 | +### Development |
| 219 | +- Use smaller VM sizes (B-series) |
| 220 | +- Stop resources when not in use |
| 221 | +- Use Azure Dev/Test subscriptions |
| 222 | +- Disable auto-scaling |
| 223 | + |
| 224 | +### Production |
| 225 | +- Right-size VMs based on load |
| 226 | +- Use reserved instances |
| 227 | +- Implement auto-scaling |
| 228 | +- Use Azure Cost Management |
| 229 | +- Set up budget alerts |
| 230 | + |
| 231 | +--- |
| 232 | + |
| 233 | +## Troubleshooting |
| 234 | + |
| 235 | +### Common Issues |
| 236 | + |
| 237 | +1. **Container Image Pull Errors** |
| 238 | + - Verify registry credentials |
| 239 | + - Check image name and tag |
| 240 | + - Ensure network connectivity |
| 241 | + |
| 242 | +2. **Database Connection Issues** |
| 243 | + - Verify connection strings |
| 244 | + - Check firewall rules |
| 245 | + - Validate credentials |
| 246 | + |
| 247 | +3. **Terraform State Conflicts** |
| 248 | + - Use remote state with locking |
| 249 | + - Coordinate team deployments |
| 250 | + - Use workspaces |
| 251 | + |
| 252 | +4. **Kubernetes Pod Crashes** |
| 253 | + - Check pod logs: `kubectl logs <pod-name>` |
| 254 | + - Verify resource limits |
| 255 | + - Check health probe configurations |
| 256 | + |
| 257 | +--- |
| 258 | + |
| 259 | +## Next Steps |
| 260 | + |
| 261 | +1. Choose your deployment path based on requirements |
| 262 | +2. Review the specific documentation for your chosen method |
| 263 | +3. Set up prerequisites |
| 264 | +4. Follow the deployment guide |
| 265 | +5. Configure monitoring and alerting |
| 266 | +6. Document your deployment specifics |
| 267 | + |
| 268 | +--- |
| 269 | + |
| 270 | +## Support and Resources |
| 271 | + |
| 272 | +- **Documentation**: See individual README files in each directory |
| 273 | +- **Issues**: [GitHub Issues](https://github.com/MicrosoftLearning/eShopOnWeb/issues) |
| 274 | +- **Kubernetes Docs**: https://kubernetes.io/docs/ |
| 275 | +- **Terraform Docs**: https://www.terraform.io/docs |
| 276 | +- **Azure Docs**: https://docs.microsoft.com/azure/ |
| 277 | + |
| 278 | +--- |
| 279 | + |
| 280 | +## Contributing |
| 281 | + |
| 282 | +To add new deployment options: |
| 283 | +1. Create a new directory under `/deploy/` |
| 284 | +2. Include comprehensive README.md |
| 285 | +3. Provide example configurations |
| 286 | +4. Update this guide |
| 287 | +5. Submit a pull request |
0 commit comments