New enterprise feature2

This commit is contained in:
Urtzi Alfaro
2025-11-30 16:29:38 +01:00
parent 972db02f6d
commit 0da0470786
18 changed files with 698 additions and 76 deletions

View File

@@ -23,34 +23,31 @@ spec:
app: demo-cleanup
spec:
containers:
- name: cleanup
image: bakery/demo-session-service:latest
- name: cleanup-trigger
image: curlimages/curl:latest
command:
- python
- sh
- -c
- |
import asyncio
import httpx
async def cleanup():
async with httpx.AsyncClient() as client:
response = await client.post("http://demo-session-service:8000/api/v1/demo/operations/cleanup")
print(response.json())
asyncio.run(cleanup())
env:
- name: DEMO_SESSION_DATABASE_URL
valueFrom:
secretKeyRef:
name: database-secrets
key: DEMO_SESSION_DATABASE_URL
- name: REDIS_URL
value: "redis://redis-service:6379/0"
- name: LOG_LEVEL
value: "INFO"
echo "Triggering demo session cleanup..."
response=$(curl -s -w "\n%{http_code}" -X POST http://demo-session-service:8000/api/v1/demo/operations/cleanup)
http_code=$(echo "$response" | tail -n 1)
body=$(echo "$response" | sed '$d')
echo "Response: $body"
echo "HTTP Status: $http_code"
if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]; then
echo "Cleanup job enqueued successfully"
exit 0
else
echo "Failed to enqueue cleanup job"
exit 1
fi
resources:
requests:
memory: "128Mi"
cpu: "50m"
memory: "32Mi"
cpu: "10m"
limits:
memory: "256Mi"
cpu: "200m"
memory: "64Mi"
cpu: "50m"
restartPolicy: OnFailure
activeDeadlineSeconds: 30