Django rq worker process not starting on first deployment to kubernetes

1/29/2020

I am running a django_rq instance in kubernetes with a deployment that has a local redis instance inside. I am having trouble getting the worker to actually start. When first deploying the solution with the following settings:

- name: rq-worker
    image: eu.gcr.io/*****
    volumeMounts:
      - name: sa-key
        mountPath: /var/secrets/credentials
        readOnly: true
    imagePullPolicy: IfNotPresent
    resources:
      requests:
        cpu: 100m
        memory: 100Mi
    command: ["./manage.py"]
    args: ["rqworker", "*****"]
  - name: redis
    image: redis
    ports:
      - containerPort: 6379

The worker never starts. I can see this in the django-rq queue.

But if i remove the pod and let them recreate the worker is started, with no changes to the deployment. I do not get any logs at all on first deploy. There seems to be something wrong when accessing the process on first deploy, but my kubernetes knowledge doesnt let me fix this.

Any ideas would be really appreciated.

-- The Kaizer
django
django-rq
kubernetes
redis

0 Answers