1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: pdf-parser-config
- namespace: mantis
- labels:
- app: pdf-parser
- type: config
- group: consumer
- data:
- entrypoint.sh: |
- python -m pip install 'pip==21.0'
- pip3 install rabbitmq-pdfparser
- rabbitmq-pdfparser
- ---
- apiVersion: batch/v1beta1
- kind: CronJob
- metadata:
- labels:
- app: pdf-parser
- type: config
- group: consumer
- name: pdf-parser-job
- namespace: mantis
- spec:
- concurrencyPolicy: Forbid
- schedule: "0 */6 * * *"
- suspend: false
- jobTemplate:
- spec:
- backoffLimit: 0
- template:
- metadata:
- labels:
- app: pdf-parser
- spec:
- restartPolicy: Never
- containers:
- - command:
- - /bin/sh
- - -c
- - "/bin/sh /config/entrypoint.sh"
- image: python:3.6
- env:
- - name: MQ_HOST
- value: "<MQ_URL>"
- - name: MQ_PORT
- value: "5672"
- - name: MQ_VHOST
- value: "/"
- - name: MQ_USER
- value: "mantis"
- - name: MQ_PASS
- value: "mantis"
- - name: MQ_SOURCE_QUEUE
- value: "pdflinks"
- - name: MQ_TARGET_EXCHANGE
- value: pdfparser
- - name: MQ_TARGET_ROUTING_KEY
- value: pdfparser
- - name: CONSUMER_POOL_SIZE
- value: "10"
- - name: LOG_LEVEL
- value: "DEBUG"
- resources:
- limits:
- memory: "512Mi"
- cpu: "500"
- requests:
- memory: "400Mi"
- cpu: "100m"
- name: pdf-parser
- volumeMounts:
- - mountPath: /config
- name: pdf-parser-deploy
- volumes:
- - configMap:
- defaultMode: 420
- name: pdf-parser-config
- items:
- - key: "entrypoint.sh"
- path: "entrypoint.sh"
- name: pdf-parser-deploy
|