diff --git a/nautilus/api-worker/redis.yaml b/nautilus/api-worker/redis.yaml new file mode 100644 index 0000000..09fbe16 --- /dev/null +++ b/nautilus/api-worker/redis.yaml @@ -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 diff --git a/nautilus/api-worker/worker.yaml b/nautilus/api-worker/worker.yaml new file mode 100644 index 0000000..26943d3 --- /dev/null +++ b/nautilus/api-worker/worker.yaml @@ -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" diff --git a/nautilus/api/api-configs.cm.yaml b/nautilus/api/api-configs.cm.yaml index 2892b72..5d796b6 100644 --- a/nautilus/api/api-configs.cm.yaml +++ b/nautilus/api/api-configs.cm.yaml @@ -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"