celery-worker.yaml 1.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
apiVersion: apps/v1
kind: Deployment
metadata:
  name: celery-worker
  labels:
      app: celery-worker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: celery-worker
  template:
    metadata:
      labels:
        app: celery-worker
    spec:
      containers:
      - name: celery-worker
        image: $CI_REGISTRY_IMAGE/backend:${CI_COMMIT_REF_NAME}
        imagePullPolicy: Always
21
22
        args:
          - /code/scripts/run_celery.sh
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        env:
        - name: DATABASE_HOST
          value: postgresql
        - name: DATABASE_NAME
          valueFrom:
            secretKeyRef:
              name: postgresql-credentials
              key: database
        - name: DATABASE_USER
          valueFrom:
            secretKeyRef:
              name: postgresql-credentials
              key: username
        - name: DATABASE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: postgresql-credentials
              key: password
        - name: SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: backend-secret
              key: secret_key
        - name: REDIS_HOST
          value: redis
48
49
        - name: REDIS_PORT
          value: '6379'
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
        resources:
          requests:
            memory: "4Gi"
            cpu: "1000m"
          limits:
            memory: "8Gi"
            cpu: "2000m"
        volumeMounts:
        - name: static-data
          mountPath: /code/public/static
      imagePullSecrets:
      - name: registry-gitlab
      volumes:
      - name: postgresql-credentials
        secret:
          secretName: postgresql-credentials
      - name: static-data
        emptyDir: {}