Skip to content

Commit

Permalink
added redis and worker for nautilus SaaS
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Aug 31, 2023
1 parent af4f4d3 commit c14903d
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
46 changes: 46 additions & 0 deletions nautilus/api-worker/redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: nautilus
labels:
app: redis-app
name: redis-sts
spec:
replicas: 1
selector:
matchLabels:
app: redis-app
serviceName: redis-service
template:
metadata:
labels:
app: redis-app
spec:
containers:
- image: docker.io/library/redis:7.2
imagePullPolicy: IfNotPresent
command: ["redis-server", "--save", "", "--appendonly", "no"]
name: redis
ports:
- containerPort: 6379
resources:
requests:
memory: "256Mi"
cpu: "200m"
nodeSelector:
k8s.kiwix.org/role: "services"
---
apiVersion: v1
kind: Service
metadata:
namespace: nautilus
name: redis-service
labels:
app: redis-app
spec:
selector:
app: redis-app
ports:
- protocol: TCP
port: 6379
targetPort: 6379
42 changes: 42 additions & 0 deletions nautilus/api-worker/worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: nautilus
labels:
app: worker-app
name: api-worker-deployment
spec:
replicas: 1
selector:
matchLabels:
app: worker-app
template:
metadata:
labels:
app: worker-app
spec:
containers:
- image: ghcr.io/openzim/nautilus-webui-api:latest
imagePullPolicy: Always
command: ["rq-worker"]
name: worker
envFrom:
- configMapRef:
name: api-configs
- secretRef:
name: api-secrets
volumeMounts:
- name: files-volume
mountPath: "/tmp/transient"
readOnly: false
resources:
requests:
memory: "256Mi"
cpu: "200m"
volumes:
# /!\ this is not backed-up (considered transient)
- name: files-volume
persistentVolumeClaim:
claimName: nautilus-api-files-pvc
nodeSelector:
k8s.kiwix.org/role: "services"
2 changes: 2 additions & 0 deletions nautilus/api/api-configs.cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ data:
COOKIE_EXPIRATION_DAYS: "31"
PROJECT_QUOTA: "100MiB"
CHUNK_SIZE: "2MiB"
REDIS_URI: "redis://redis-service:6379/0"
CHANNEL_NAME: "s3_upload"

0 comments on commit c14903d

Please sign in to comment.