- Voorlopige (werkende) setup tem verification service, bunny integratie, ...
This commit is contained in:
159
documentation/Production Setup/cluster-install.md
Normal file
159
documentation/Production Setup/cluster-install.md
Normal file
@@ -0,0 +1,159 @@
|
||||
# Cluster Install
|
||||
|
||||
## Fase 1: Ingress Controller Setup
|
||||
### Stap 1: Installeer de NGINX Ingress Controller
|
||||
|
||||
```
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.2/deploy/static/provider/cloud/deploy.yaml
|
||||
```
|
||||
|
||||
### Stap 2: Verifieer de Installatie
|
||||
Kijk of de namespace is aangemaakt
|
||||
|
||||
```
|
||||
kubectl get namespaces | grep ingress-nginx
|
||||
```
|
||||
|
||||
Check of de pods worden gestart
|
||||
|
||||
```
|
||||
kubectl get pods -n ingress-nginx
|
||||
```
|
||||
|
||||
Check de services (dit is het belangrijkste!)
|
||||
|
||||
```
|
||||
kubectl get services -n ingress-nginx
|
||||
```
|
||||
|
||||
Je zou zoiets als dit moeten zien:
|
||||
|
||||
```
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
ingress-nginx-controller NodePort 10.43.xxx.xxx <none> 80:30080/TCP,443:30443/TCP 1m
|
||||
```
|
||||
|
||||
Watch de pods tot ze ready zijn
|
||||
|
||||
```
|
||||
kubectl get pods -n ingress-nginx -w
|
||||
```
|
||||
|
||||
Stop met Ctrl+C als je dit ziet:
|
||||
|
||||
```
|
||||
ingress-nginx-controller-xxx 1/1 Running 0 2m
|
||||
```
|
||||
|
||||
Check de NodePorts, dit is cruciaal voor je Scaleway LoadBalancer configuratie:
|
||||
|
||||
```
|
||||
kubectl get service ingress-nginx-controller -n ingress-nginx -o yaml | grep nodePort
|
||||
```
|
||||
|
||||
Of een overzichtelijker weergave:
|
||||
|
||||
```
|
||||
kubectl describe service ingress-nginx-controller -n ingress-nginx
|
||||
```
|
||||
|
||||
Je zoekt naar iets zoals:
|
||||
|
||||
```
|
||||
HTTP: Port 80 → NodePort 30080 (of een ander hoog nummer)
|
||||
HTTPS: Port 443 → NodePort 30443 (of een ander hoog nummer)
|
||||
```
|
||||
### Stap 3: Check de scaleway loadbalancer
|
||||
Er werd normaal gezien automatisch een loadbalancer aangemaakt. Check of dit klopt. Deze is automatisch correct geconfigureerd en kan niet worden aangepast.
|
||||
|
||||
### Stap 4: Verifieer de firewall rules
|
||||
|
||||
- Ga in de console naar Compute - CPU & GPU Instances
|
||||
- Ga naar de security groups tab
|
||||
- Klik op de security group voor je cluster (Kapsule Default Security Group)
|
||||
- Ga naar de rules tab, en check of de poort (3xxxx) is toegevoegd aan de firewall rules, en voeg die toe indien nog niet aanwezig.
|
||||
- Stel dit eerst in voor de volledige ipv4 range
|
||||
|
||||
### Stap 4: Test de Basis Setup
|
||||
Test of de ingress controller intern bereikbaar is (vervang de IP en NodePort door je eigen):
|
||||
|
||||
```
|
||||
kubectl run test-pod --image=curlimages/curl -it --rm -- curl -H "Host: evie.askeveai.com" http://172.16.16.5:31127
|
||||
```
|
||||
|
||||
Er moet een 404 boodschap komen (dat is goed! Het betekent dat nginx draait)
|
||||
|
||||
Test of de ingress controller extern bereikbaar is (pas IP aan):
|
||||
|
||||
```
|
||||
curl -H "Host: evie.askeveai.com" http://51.159.204.52
|
||||
```
|
||||
|
||||
## Fase 2: Deploy test applicatie
|
||||
|
||||
We hebben een kleine test applicatie geïntegreerd in staging-test-setup.yaml. Installeer deze via:
|
||||
|
||||
```
|
||||
kubectl apply -f staging-test-setup.yaml
|
||||
```
|
||||
|
||||
En check met
|
||||
|
||||
```
|
||||
curl -H "Host: evie-staging.askeveai.com" http://51.159.204.52/verify/
|
||||
```
|
||||
|
||||
### Later Uitbreiden
|
||||
Wanneer je echte services deploy, uncomment je de relevante ingress paths en deploy je de bijbehorende services. De verify service blijft beschikbaar voor debugging.
|
||||
Deze setup geeft je een professionele staging environment met ingebouwde monitoring en debug capabilities.
|
||||
|
||||
## Fase 3: Configureer DNS
|
||||
Maak het juist A-record aan in de DNS zone. Dit moet verwijzen naar de publieke IP van de loadbalancer.
|
||||
|
||||
Je kan testen met:
|
||||
|
||||
```
|
||||
curl http://evie-staging.askeveai.com/verify/
|
||||
```
|
||||
|
||||
In de browser zal dit waarschijnlijk niet werken, omdat de site nog niet is beveiligd met SSL.
|
||||
|
||||
## Fase 4: Bunny CDN Setup
|
||||
Eerst zorg je dat Bunny klaar is om te werken.
|
||||
|
||||
- Creëer een Pull zone - evie-staging
|
||||
- Origin = http://[IP van load balancer]
|
||||
- Host header = evie-staging.askeveai.com
|
||||
- Force SSL - Aan
|
||||
|
||||
Daarna wijzig je A-record in de DNS zone. (waarschijnlijk verwijderen en CNAME record toevoegen)
|
||||
|
||||
## Fase 5: Introductie Secure communication
|
||||
|
||||
### Installatie van SSL Certificaat in de bunny pull zone
|
||||
- Voeg een hostname toe aan de bunny pull zone (evie-staging.askeveai.com)
|
||||
- Voeg een SSL certificaat toe aan de bunny pull zone (volg gewoon de instructies)
|
||||
- Enable Force SSL
|
||||
|
||||
Je kan checken met:
|
||||
|
||||
```
|
||||
curl https://evie-staging.askeveai.com/verify/
|
||||
```
|
||||
|
||||
### Installatie cert-manager in de cluster
|
||||
|
||||
```
|
||||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.crds.yaml
|
||||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml
|
||||
```
|
||||
|
||||
En het cert-manager-setup.yaml manifest toepassen (zorgen dat email adres en domein correct zijn)
|
||||
|
||||
```
|
||||
kubectl apply -f cert-manager-setup.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
461
documentation/Production Setup/eveai_architecture.md
Normal file
461
documentation/Production Setup/eveai_architecture.md
Normal file
@@ -0,0 +1,461 @@
|
||||
# EveAI Cloud Architectuur
|
||||
|
||||
## Overzicht
|
||||
De EveAI applicatie draait op een moderne cloud-native architectuur met Kubernetes op Scaleway, beschermd door Bunny.net CDN en ondersteund door diverse managed services.
|
||||
|
||||
## Architectuurdiagram (Aanbevolen Setup)
|
||||
|
||||
```
|
||||
Internet
|
||||
↓
|
||||
DNS (askeveai.com - alle subdomains)
|
||||
↓
|
||||
Bunny.net CDN (Multi-domain setup)
|
||||
├─ askeveai.com → WordPress Hosting -> Scaleway hosting (voorlopig enkel via plugin)
|
||||
├─ evie-staging.askeveai.com → Scaleway LB → Staging Cluster
|
||||
└─ evie.askeveai.com → Scaleway LB → Production Cluster
|
||||
↓
|
||||
Scaleway Load Balancer (Statisch IP)
|
||||
↓
|
||||
Kubernetes Cluster (Scaleway)
|
||||
↓
|
||||
Ingress Controller
|
||||
↓
|
||||
┌─────────────────────────────────────┐
|
||||
│ Applicaties │
|
||||
├─────────────────────────────────────┤
|
||||
│ • eveai_app (staging/production) │
|
||||
│ • eveai_api (staging/production) │
|
||||
│ • eveai_workers (staging/production)│
|
||||
│ • [andere pods] │
|
||||
└─────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────┐
|
||||
│ Managed Services │
|
||||
├─────────────────────────────────────┤
|
||||
│ • Redis (per environment) │
|
||||
│ • PostgreSQL (per environment) │
|
||||
│ • Object Storage (S3/Minio) │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Componenten
|
||||
|
||||
### 1. CDN & Security Layer
|
||||
**Bunny.net CDN**
|
||||
- **Functie**: Content Delivery Network en security gateway
|
||||
- **Voordelen**:
|
||||
- DDoS bescherming en attack mitigation
|
||||
- Caching van statische bestanden
|
||||
- Ontlasting van de backend cluster
|
||||
- Verbeterde loading times voor eindgebruikers
|
||||
- Web Application Firewall functionaliteit
|
||||
|
||||
### 2. DNS & Multi-Domain Routing
|
||||
|
||||
**DNS Provider: EuroDNS**
|
||||
- **Hosting**: hosting.com (alleen WordPress hosting)
|
||||
- **Email**: ProtonMail (via domein records)
|
||||
- **Application**: Scaleway cluster
|
||||
|
||||
**Bunny.net Pull Zone Setup**
|
||||
- **Zone 1**: `askeveai.com` → Origin: hosting.com WordPress
|
||||
- **Zone 2**: `evie-staging.askeveai.com` → Origin: Scaleway LB IP
|
||||
- **Zone 3**: `evie.askeveai.com` → Origin: Scaleway LB IP
|
||||
|
||||
**DNS Records (EuroDNS) - Uitgebreid**
|
||||
```
|
||||
; Web traffic via Bunny.net
|
||||
A askeveai.com → Scaleway hosting IP
|
||||
A evie-staging.askeveai.com → Bunny.net IP
|
||||
A evie.askeveai.com → Bunny.net IP
|
||||
A static.askeveai.com → Bunny.net IP (voor static assets)
|
||||
|
||||
; Email records (ProtonMail) - blijven direct
|
||||
MX askeveai.com → mail.protonmail.ch (priority 10)
|
||||
MX askeveai.com → mailsec.protonmail.ch (priority 20)
|
||||
TXT askeveai.com → "v=spf1 include:_spf.protonmail.ch ~all"
|
||||
TXT protonmail._domainkey.askeveai.com → [DKIM key van ProtonMail]
|
||||
TXT _dmarc.askeveai.com → "v=DMARC1; p=quarantine; rua=..."
|
||||
|
||||
; Subdomains for email (if needed)
|
||||
CNAME autodiscover.askeveai.com → autodiscover.protonmail.ch
|
||||
CNAME autoconfig.askeveai.com → autoconfig.protonmail.ch
|
||||
```
|
||||
|
||||
### 3. Infrastructure Layer
|
||||
**Scaleway Load Balancer**
|
||||
- **Type**: Statisch extern IP adres
|
||||
- **Functie**: Entry point naar Kubernetes cluster
|
||||
- **Locatie**: Voor de cluster, distribueert verkeer naar Ingress
|
||||
|
||||
**Kubernetes Cluster (Scaleway)**
|
||||
- **Ingress Controller**: Routeert aanvragen naar juiste services
|
||||
- **Workloads**:
|
||||
- `eveai_app`: Frontend applicatie
|
||||
- `eveai_api`: Backend API services
|
||||
- `eveai_workers`: Background processing
|
||||
- Aanvullende applicatieve pods
|
||||
|
||||
### 4. Monitoring & Observability
|
||||
**Prometheus Stack (In-cluster)**
|
||||
- **Functie**: Business events monitoring
|
||||
- **Scope**: Applicatie-specifieke metrics en events
|
||||
|
||||
**Scaleway Cockpit**
|
||||
- **Functie**: Infrastructure monitoring
|
||||
- **Scope**: Performance en infrastructuur componenten
|
||||
|
||||
### 5. Managed Services
|
||||
**Redis (Scaleway Managed)**
|
||||
- **Functie**: Caching layer
|
||||
- **Voordeel**: Reduced latency, session storage
|
||||
|
||||
**PostgreSQL (Scaleway Managed)**
|
||||
- **Functie**: Primaire database
|
||||
- **Voordeel**: Managed backups, high availability
|
||||
|
||||
**Object Storage (Scaleway)**
|
||||
- **Interface**: S3-compatible via Minio client
|
||||
- **Functie**: File storage, static assets, backups
|
||||
|
||||
## Architectuuroverwegingen
|
||||
|
||||
### Huidige Setup Evaluatie
|
||||
|
||||
**Sterke Punten:**
|
||||
- ✅ Goede separation of concerns
|
||||
- ✅ Gebruik van managed services vermindert operationele overhead
|
||||
- ✅ CDN voor performance en security
|
||||
- ✅ Container-native met Kubernetes
|
||||
- ✅ Comprehensive monitoring setup
|
||||
|
||||
**Potentiële Verbeteringen:**
|
||||
- ✅ **Multi-domain setup via Bunny.net**: Alle traffic via CDN
|
||||
- ✅ **Environment isolation**: Aparte origins voor staging/production
|
||||
- 🤔 **Origin Protection**: Firewall rules om direct access te voorkomen
|
||||
- 🤔 **Kubernetes Ingress**: Host-based routing configureren voor multi-environment
|
||||
|
||||
## Email & DNS Overwegingen
|
||||
|
||||
### Email via ProtonMail (Blijft Direct)
|
||||
**Belangrijke opmerking**: Email records gaan **NIET** via Bunny.net. CDN's zijn alleen voor web traffic (HTTP/HTTPS). Email gebruikt andere protocollen (SMTP, IMAP, POP3) die niet via een CDN kunnen.
|
||||
|
||||
**Wat blijft hetzelfde:**
|
||||
- MX records blijven wijzen naar ProtonMail servers
|
||||
- SPF, DKIM, DMARC records blijven ongewijzigd
|
||||
- Email functionaliteit wordt niet beïnvloed door Bunny.net
|
||||
|
||||
**Voordeel van je setup:**
|
||||
- DNS bij EuroDNS: Flexibel om records te beheren
|
||||
- Hosting bij hosting.com: Makkelijk te migreren later
|
||||
- Email bij ProtonMail: Blijft stabiel tijdens migraties
|
||||
|
||||
### DNS Migratie Strategie (Vereenvoudigd)
|
||||
|
||||
**Huidige situatie:**
|
||||
```
|
||||
EuroDNS → hosting.com (WordPress + email config via cPanel)
|
||||
```
|
||||
|
||||
**Nieuwe situatie:**
|
||||
```
|
||||
EuroDNS → Bunny.net (web) + ProtonMail (email direct)
|
||||
```
|
||||
|
||||
**Migratiestappen:**
|
||||
1. **Preparatie**: Email records van cPanel naar EuroDNS overbrengen
|
||||
2. **Bunny.net setup**: Pull zones configureren
|
||||
3. **DNS switch**: A records naar Bunny.net, MX records direct naar ProtonMail
|
||||
4. **Later**: hosting.com opzeggen
|
||||
|
||||
## Bunny.net Setup Guide
|
||||
|
||||
### Stap 1: Pull Zones Aanmaken
|
||||
|
||||
**Pull Zone 1: WordPress Site**
|
||||
```
|
||||
Name: askeveai-wordpress
|
||||
Hostname: askeveai.com
|
||||
Origin URL: [hosting.com server IP/URL]
|
||||
```
|
||||
|
||||
**Pull Zone 2: Staging Environment**
|
||||
```
|
||||
Name: evie-staging
|
||||
Hostname: evie-staging.askeveai.com
|
||||
Origin URL: http://[scaleway-lb-ip]
|
||||
Host Header: evie-staging.askeveai.com
|
||||
```
|
||||
|
||||
**Pull Zone 3: Production Environment**
|
||||
```
|
||||
Name: evie-production
|
||||
Hostname: evie.askeveai.com
|
||||
Origin URL: http://[scaleway-lb-ip]
|
||||
Host Header: evie.askeveai.com
|
||||
```
|
||||
|
||||
**Pull Zone 4: Static Assets - Bunny Storage (Aanbevolen)**
|
||||
```
|
||||
Name: static-assets
|
||||
Type: Push Zone (Bunny Storage)
|
||||
Hostname: static.askeveai.com
|
||||
Storage: Direct upload to Bunny Storage
|
||||
API: FTP/SFTP/REST API upload
|
||||
```
|
||||
|
||||
**Alternatief: Pull Zone van Scaleway S3**
|
||||
```
|
||||
Name: static-assets-s3
|
||||
Type: Pull Zone
|
||||
Hostname: static.askeveai.com
|
||||
Origin URL: https://[scaleway-s3-bucket].s3.fr-par.scw.cloud
|
||||
```
|
||||
|
||||
### Stap 2: SSL/TLS Configuratie
|
||||
- **Force SSL**: Aan voor alle zones
|
||||
- **SSL Certificate**: Let's Encrypt (gratis) of Bunny.net certificates
|
||||
- **Origin Shield**: Europa (voor betere performance naar Scaleway)
|
||||
|
||||
### Stap 3: Security Settings
|
||||
- **Origin Shield Protection**: Alleen Bunny.net IP's kunnen origin bereiken
|
||||
- **WAF Rules**: Basis DDoS en attack protection
|
||||
- **Rate Limiting**: Per domain/endpoint configureren
|
||||
|
||||
## Static Assets Optimalisatie
|
||||
|
||||
### Huidige Aanpak (Sub-optimaal)
|
||||
```
|
||||
Browser → Bunny.net → Scaleway LB → Ingress → App Pod → Static file
|
||||
```
|
||||
|
||||
### Aanbevolen Aanpak: Direct Static Delivery
|
||||
```
|
||||
Browser → Bunny.net Edge → Static file (gecached op edge)
|
||||
```
|
||||
|
||||
### Implementatie Strategieën
|
||||
|
||||
**Optie 1: Bunny Storage (Aanbevolen)**
|
||||
```
|
||||
Build Process → Bunny Storage → Bunny CDN Edge → Browser
|
||||
- Upload: Direct naar Bunny Storage via API/FTP
|
||||
- Serve: Native performance, geen extra hops
|
||||
- Cost: Meestal goedkoper dan S3 + CDN
|
||||
- Speed: Optimaal, storage en CDN geïntegreerd
|
||||
```
|
||||
|
||||
**Optie 2: Scaleway Object Storage + Pull Zone**
|
||||
```
|
||||
Build Process → Scaleway S3 → Bunny Pull Zone → Browser
|
||||
- Upload: App → Scaleway S3 bucket
|
||||
- Serve: Bunny.net cache van S3 bucket
|
||||
- Voordeel: Backup in je eigen cloud, data sovereignty
|
||||
- Nadeel: Extra latency voor eerste request
|
||||
```
|
||||
|
||||
**Optie 3: Hybrid Approach**
|
||||
```
|
||||
- Critical assets: Bunny Storage (logo, CSS, JS)
|
||||
- User uploads: Scaleway S3 → Bunny Pull Zone
|
||||
- Development: Local static serving
|
||||
```
|
||||
|
||||
### Bunny Storage vs Scaleway S3
|
||||
|
||||
| Aspect | Bunny Storage | Scaleway S3 + Pull Zone |
|
||||
|--------|---------------|-------------------------|
|
||||
| **Performance** | ⭐⭐⭐⭐⭐ Native CDN | ⭐⭐⭐⭐ Extra hop |
|
||||
| **Cost** | ⭐⭐⭐⭐⭐ Integrated pricing | ⭐⭐⭐ S3 + CDN costs |
|
||||
| **Simplicity** | ⭐⭐⭐⭐⭐ One provider | ⭐⭐⭐ Two systems |
|
||||
| **Data Control** | ⭐⭐⭐ At Bunny | ⭐⭐⭐⭐⭐ In your cloud |
|
||||
| **Backup/Sync** | ⭐⭐⭐ Bunny dependent | ⭐⭐⭐⭐⭐ Full control |
|
||||
|
||||
### File Types voor Static Delivery
|
||||
**Ideaal voor CDN:**
|
||||
- ✅ Images (JPG, PNG, WebP, SVG)
|
||||
- ✅ CSS files
|
||||
- ✅ JavaScript bundles
|
||||
- ✅ Fonts (WOFF2, etc.)
|
||||
- ✅ Videos/audio files
|
||||
- ✅ PDF documents
|
||||
- ✅ Icons en favicons
|
||||
|
||||
**Blijven via app:**
|
||||
- ❌ Dynamic API responses
|
||||
- ❌ User-generated content (tenzij via upload flow)
|
||||
- ❌ Authentication-required files
|
||||
|
||||
## Kubernetes Ingress Configuratie
|
||||
|
||||
Met de multi-domain setup via Bunny.net moet je Ingress ook aangepast worden:
|
||||
|
||||
```yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: eveai-ingress
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "false" # SSL handled by Bunny.net
|
||||
spec:
|
||||
rules:
|
||||
- host: evie-staging.askeveai.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: eveai-staging-service
|
||||
port:
|
||||
number: 80
|
||||
- host: evie.askeveai.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: eveai-production-service
|
||||
port:
|
||||
number: 80
|
||||
```
|
||||
|
||||
## Migratiestrategie (Uitgebreid)
|
||||
|
||||
### Fase 1: Bunny.net Setup (Geen downtime)
|
||||
1. Maak Pull Zones aan in Bunny.net
|
||||
2. Test via Bunny.net hostnames (zonder DNS wijziging)
|
||||
3. Configureer caching en security rules
|
||||
|
||||
### Fase 2: DNS Migratie (Minimale downtime)
|
||||
1. Kopieer email records van cPanel naar EuroDNS
|
||||
2. Verlaag TTL van huidige DNS records (1 uur van tevoren)
|
||||
3. Wijzig A records naar Bunny.net (MX records blijven ProtonMail)
|
||||
4. Monitor traffic en performance
|
||||
|
||||
### Fase 3: Origin Protection
|
||||
1. Configureer Scaleway firewall om alleen Bunny.net IP's toe te laten
|
||||
2. Test alle functionaliteit
|
||||
3. Monitor security logs
|
||||
|
||||
### Fase 4: WordPress Migratie naar Scaleway (Optioneel)
|
||||
**Planning overwegingen:**
|
||||
- **Database**: WordPress DB naar Scaleway PostgreSQL of aparte MySQL
|
||||
- **Files**: wp-content naar Scaleway Object Storage
|
||||
- **SSL**: Blijft via Bunny.net (geen wijzigingen)
|
||||
- **Performance**: Mogelijk sneller door proximity met EveAI
|
||||
|
||||
**Migratie opties:**
|
||||
1. **Lift & Shift**: VM op Scaleway met traditionele LAMP stack
|
||||
2. **Modernisering**: WordPress in Kubernetes container
|
||||
3. **Hybrid**: Behoud hosting.com tot je tevreden bent met K8s setup
|
||||
|
||||
### Fase 5: Hosting.com Opzegging
|
||||
1. Bevestig WordPress werkt 100% op Scaleway
|
||||
2. Final backup van hosting.com
|
||||
3. Annuleer hosting.com contract
|
||||
4. Email en EveAI blijven ongestoord werken
|
||||
|
||||
## Toekomstige Evolutie: WordPress op Scaleway
|
||||
|
||||
### Optie 1: WordPress als Managed Service
|
||||
**Scaleway WordPress Hosting** (als beschikbaar)
|
||||
- Managed WordPress environment
|
||||
- Automatische updates en backups
|
||||
- Geïntegreerd met andere Scaleway services
|
||||
|
||||
### Optie 2: WordPress in Kubernetes Cluster
|
||||
**Voordelen:**
|
||||
- ✅ Alles op één platform (Scaleway)
|
||||
- ✅ Gedeelde resources en monitoring
|
||||
- ✅ Consistent deployment pipeline
|
||||
- ✅ Cost optimization
|
||||
- ✅ Uniform backup/disaster recovery
|
||||
|
||||
**WordPress in K8s Setup:**
|
||||
```yaml
|
||||
# WordPress Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: wordpress-deployment
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: wordpress
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: wordpress
|
||||
image: wordpress:6-apache
|
||||
env:
|
||||
- name: WORDPRESS_DB_HOST
|
||||
value: [scaleway-postgresql-endpoint]
|
||||
- name: WORDPRESS_DB_NAME
|
||||
value: wordpress_db
|
||||
volumeMounts:
|
||||
- name: wordpress-storage
|
||||
mountPath: /var/www/html/wp-content
|
||||
volumes:
|
||||
- name: wordpress-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: wordpress-pvc
|
||||
```
|
||||
|
||||
### Optie 3: WordPress op Scaleway Instances
|
||||
**Instance-based hosting:**
|
||||
- Dedicated VM voor WordPress
|
||||
- Meer controle over environment
|
||||
- Traditionele hosting aanpak op moderne cloud
|
||||
|
||||
### Aanbevolen Aanpak: Kubernetes
|
||||
**Architectuur zou worden:**
|
||||
```
|
||||
Bunny.net CDN
|
||||
├─ askeveai.com → Scaleway LB → WordPress Pod
|
||||
├─ evie-staging.askeveai.com → Scaleway LB → EveAI Staging
|
||||
└─ evie.askeveai.com → Scaleway LB → EveAI Production
|
||||
```
|
||||
|
||||
**Gedeelde Resources:**
|
||||
- **PostgreSQL**: Aparte database voor WordPress + EveAI
|
||||
- **Object Storage**: WordPress media + EveAI assets
|
||||
- **Redis**: WordPress caching + EveAI caching
|
||||
- **Monitoring**: Unified observability voor alles
|
||||
|
||||
## Disaster Recovery & Backup
|
||||
|
||||
- **Database**: Managed PostgreSQL automated backups
|
||||
- **Object Storage**: Cross-region replication overwegen
|
||||
- **Application State**: Stateless design waar mogelijk
|
||||
- **Configuration**: GitOps approach voor cluster configuration
|
||||
|
||||
## Conclusie
|
||||
|
||||
De voorgestelde architectuur biedt een uitstekende balans tussen performance, security en operationele eenvoud. Door alles via Bunny.net te routeren krijg je:
|
||||
|
||||
**Directe voordelen:**
|
||||
- Uniforme security en performance voor alle domeinen
|
||||
- Eenvoudige SSL management
|
||||
- Cost-effective CDN voor alle content
|
||||
- Flexibiliteit voor toekomstige migraties
|
||||
|
||||
**Strategische voordelen:**
|
||||
- **Scaleway consolidatie**: Mogelijk om WordPress ook naar Scaleway te migreren
|
||||
- **Operational simplicity**: Eén cloud provider voor applicatie infrastructure
|
||||
- **Cost optimization**: Gedeelde resources en bundelvoordelen
|
||||
- **Technical consistency**: Uniform tooling en monitoring
|
||||
|
||||
**Aanbevolen roadmap:**
|
||||
1. **Nu**: Bunny.net implementeren voor alle domeinen
|
||||
2. **Q1 2026**: WordPress evalueren voor Scaleway migratie
|
||||
3. **Q2 2026**: hosting.com contract beëindigen
|
||||
4. **Resultaat**: Volledig cloud-native platform op Scaleway + Bunny.net
|
||||
|
||||
Deze aanpak maximaliseert flexibiliteit terwijl risico's worden geminimaliseerd door gefaseerde implementatie.
|
||||
|
||||
---
|
||||
*Architectuurdocument gegenereerd op: Augustus 2025*
|
||||
@@ -0,0 +1,104 @@
|
||||
graph TB
|
||||
%% External Users
|
||||
Users[👥 Users] --> Internet[🌐 Internet]
|
||||
|
||||
%% DNS Layer
|
||||
Internet --> EuroDNS[📡 EuroDNS<br/>askeveai.com]
|
||||
|
||||
%% Email Flow (Direct)
|
||||
EuroDNS --> ProtonMail[📧 ProtonMail<br/>MX Records]
|
||||
|
||||
%% Web Traffic via Bunny.net
|
||||
EuroDNS --> BunnyNet[🐰 Bunny.net CDN]
|
||||
|
||||
%% Bunny.net Pull Zones + Storage
|
||||
BunnyNet --> WP_Zone[📝 WordPress Zone<br/>askeveai.com]
|
||||
BunnyNet --> Staging_Zone[🧪 Staging Zone<br/>evie-staging.askeveai.com]
|
||||
BunnyNet --> Prod_Zone[🚀 Production Zone<br/>evie.askeveai.com]
|
||||
BunnyNet --> Static_Zone[📦 Static Assets Zone<br/>static.askeveai.com]
|
||||
BunnyNet --> BunnyStorage[🗂️ Bunny Storage<br/>Static Files]
|
||||
|
||||
%% WordPress Origin
|
||||
WP_Zone --> HostingCom[🏠 hosting.com<br/>WordPress Site]
|
||||
|
||||
%% Scaleway Infrastructure
|
||||
subgraph Scaleway["☁️ Scaleway Cloud Platform"]
|
||||
|
||||
%% Load Balancer
|
||||
ScalewayLB[⚖️ Load Balancer<br/>Static IP]
|
||||
|
||||
%% Kubernetes Cluster
|
||||
subgraph K8sCluster["🐳 Kubernetes Cluster"]
|
||||
Ingress[🚪 Ingress Controller<br/>Host-based Routing]
|
||||
|
||||
%% Application Pods
|
||||
subgraph AppPods["📱 Application Pods"]
|
||||
EveAI_App[evie_app<br/>Frontend]
|
||||
EveAI_API[evie_api<br/>Backend API]
|
||||
EveAI_Workers[evie_workers<br/>Background Jobs]
|
||||
Other_Pods[... other pods]
|
||||
end
|
||||
|
||||
%% Monitoring
|
||||
subgraph Monitoring["📊 Monitoring"]
|
||||
Prometheus[🔥 Prometheus<br/>Business Events]
|
||||
Grafana[📈 Grafana<br/>Dashboards]
|
||||
end
|
||||
end
|
||||
|
||||
%% Managed Services
|
||||
subgraph ManagedServices["🛠️ Managed Services"]
|
||||
Redis[🔴 Redis<br/>Caching Layer]
|
||||
PostgreSQL[🐘 PostgreSQL<br/>Database]
|
||||
ObjectStorage[📂 Object Storage<br/>S3 Compatible]
|
||||
end
|
||||
|
||||
%% Cockpit Monitoring
|
||||
Cockpit[🚁 Scaleway Cockpit<br/>Infrastructure Monitoring]
|
||||
end
|
||||
|
||||
%% Connections to Scaleway
|
||||
Staging_Zone --> ScalewayLB
|
||||
Prod_Zone --> ScalewayLB
|
||||
Static_Zone --> BunnyStorage
|
||||
|
||||
%% Internal Scaleway Connections
|
||||
ScalewayLB --> Ingress
|
||||
|
||||
Ingress --> EveAI_App
|
||||
Ingress --> EveAI_API
|
||||
Ingress --> EveAI_Workers
|
||||
Ingress --> Other_Pods
|
||||
|
||||
EveAI_App --> Redis
|
||||
EveAI_API --> PostgreSQL
|
||||
EveAI_API --> Redis
|
||||
EveAI_Workers --> PostgreSQL
|
||||
EveAI_Workers --> Redis
|
||||
EveAI_API --> ObjectStorage
|
||||
|
||||
%% Monitoring Connections
|
||||
EveAI_App --> Prometheus
|
||||
EveAI_API --> Prometheus
|
||||
EveAI_Workers --> Prometheus
|
||||
Prometheus --> Grafana
|
||||
|
||||
%% Cockpit monitors everything
|
||||
ScalewayLB --> Cockpit
|
||||
K8sCluster --> Cockpit
|
||||
ManagedServices --> Cockpit
|
||||
|
||||
%% Styling
|
||||
classDef bunnynet fill:#ff6b35,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef scaleway fill:#4c1d95,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef external fill:#10b981,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef monitoring fill:#f59e0b,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef managed fill:#8b5cf6,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef apps fill:#06b6d4,stroke:#333,stroke-width:2px,color:#fff
|
||||
|
||||
class BunnyNet,WP_Zone,Staging_Zone,Prod_Zone,Static_Zone,BunnyStorage bunnynet
|
||||
class EuroDNS,ProtonMail,HostingCom,Users,Internet external
|
||||
class ScalewayLB,Ingress,Cockpit scaleway
|
||||
class Prometheus,Grafana monitoring
|
||||
class Redis,PostgreSQL,ObjectStorage managed
|
||||
class EveAI_App,EveAI_API,EveAI_Workers,Other_Pods apps
|
||||
Reference in New Issue
Block a user