kube.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: pdf-parser-config
  5. namespace: mantis
  6. labels:
  7. app: pdf-parser
  8. type: config
  9. group: consumer
  10. data:
  11. entrypoint.sh: |
  12. python -m pip install 'pip==21.0'
  13. pip3 install rabbitmq-pdfparser
  14. rabbitmq-pdfparser
  15. ---
  16. apiVersion: batch/v1beta1
  17. kind: CronJob
  18. metadata:
  19. labels:
  20. app: pdf-parser
  21. type: config
  22. group: consumer
  23. name: pdf-parser-job
  24. namespace: mantis
  25. spec:
  26. concurrencyPolicy: Forbid
  27. schedule: "0 */6 * * *"
  28. suspend: false
  29. jobTemplate:
  30. spec:
  31. backoffLimit: 0
  32. template:
  33. metadata:
  34. labels:
  35. app: pdf-parser
  36. spec:
  37. restartPolicy: Never
  38. containers:
  39. - command:
  40. - /bin/sh
  41. - -c
  42. - "/bin/sh /config/entrypoint.sh"
  43. image: python:3.6
  44. env:
  45. - name: MQ_HOST
  46. value: "<MQ_URL>"
  47. - name: MQ_PORT
  48. value: "5672"
  49. - name: MQ_VHOST
  50. value: "/"
  51. - name: MQ_USER
  52. value: "mantis"
  53. - name: MQ_PASS
  54. value: "mantis"
  55. - name: MQ_SOURCE_QUEUE
  56. value: "pdflinks"
  57. - name: MQ_TARGET_EXCHANGE
  58. value: pdfparser
  59. - name: MQ_TARGET_ROUTING_KEY
  60. value: pdfparser
  61. - name: CONSUMER_POOL_SIZE
  62. value: "10"
  63. - name: LOG_LEVEL
  64. value: "DEBUG"
  65. resources:
  66. limits:
  67. memory: "512Mi"
  68. cpu: "500"
  69. requests:
  70. memory: "400Mi"
  71. cpu: "100m"
  72. name: pdf-parser
  73. volumeMounts:
  74. - mountPath: /config
  75. name: pdf-parser-deploy
  76. volumes:
  77. - configMap:
  78. defaultMode: 420
  79. name: pdf-parser-config
  80. items:
  81. - key: "entrypoint.sh"
  82. path: "entrypoint.sh"
  83. name: pdf-parser-deploy