- Check-in voordat we aan bugfix beginnen te werken.

- Introductie van static-files serving met standaard nginx (niet ons docker nginx image), en een rsync service om static files te synchroniseren. Nog niet volledig afgewerkt!
This commit is contained in:
Josako
2025-08-21 05:48:03 +02:00
parent 9c63ecb17f
commit 4c00d33bc3
10 changed files with 467 additions and 194 deletions

View File

@@ -1,7 +1,7 @@
# Static Files Service for EveAI Dev Environment
# Static Files Service for EveAI Dev Environment (v2 - PersistentVolume based)
# File: static-files-service.yaml
---
# Static Files ConfigMap for nginx configuration
# Static Files ConfigMap (enhanced caching)
apiVersion: v1
kind: ConfigMap
metadata:
@@ -13,11 +13,31 @@ data:
listen 80;
server_name _;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/css application/javascript application/json image/svg+xml;
location /static/ {
alias /usr/share/nginx/html/static/;
expires 1y;
add_header Cache-Control "public, immutable";
add_header X-Content-Type-Options nosniff;
# Aggressive caching voor versioned assets
location ~* \.(js|css)$ {
expires 1y;
add_header Cache-Control "public, immutable";
add_header X-Content-Type-Options nosniff;
}
# Moderate caching voor images
location ~* \.(png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
add_header Cache-Control "public";
}
# Default caching
expires 1h;
add_header Cache-Control "public";
}
location /health {
@@ -27,7 +47,7 @@ data:
}
---
# Static Files Deployment
# Static Files Deployment (GEEN CUSTOM IMAGE!)
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -37,7 +57,7 @@ metadata:
app: static-files
environment: dev
spec:
replicas: 1
replicas: 2 # Voor high availability
selector:
matchLabels:
app: static-files
@@ -46,28 +66,15 @@ spec:
labels:
app: static-files
spec:
initContainers:
- name: copy-static-files
image: registry.ask-eve-ai-local.com/josakola/nginx:latest
command: ['sh', '-c']
args:
- |
echo "Copying static files..."
cp -r /etc/nginx/static/* /static-data/static/ 2>/dev/null || true
ls -la /static-data/static/
echo "Static files copied successfully"
volumeMounts:
- name: static-data
mountPath: /static-data
containers:
- name: nginx
image: nginx:alpine
image: nginx:alpine # 🎉 STANDARD IMAGE!
ports:
- containerPort: 80
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/conf.d
- name: static-data
- name: static-files
mountPath: /usr/share/nginx/html
livenessProbe:
httpGet:
@@ -92,11 +99,12 @@ spec:
- name: nginx-config
configMap:
name: static-files-config
- name: static-data
emptyDir: {}
- name: static-files
persistentVolumeClaim:
claimName: static-files-pvc
---
# Static Files Service
# Service (ongewijzigd)
apiVersion: v1
kind: Service
metadata: