backendaf-deployment.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ .Release.Name }}-backend-af
  5. labels:
  6. tier: aihub-dag
  7. component: backendaf
  8. release: {{ .Release.Name }}
  9. spec:
  10. replicas: {{ .Values.backendaf.replicas | default 1 }}
  11. selector:
  12. matchLabels:
  13. tier: aihub-dag
  14. component: backendaf
  15. release: {{ .Release.Name }}
  16. template:
  17. metadata:
  18. {{- with .Values.backendaf.podAnnotations }}
  19. annotations:
  20. {{- toYaml . | nindent 8 }}
  21. {{- end }}
  22. labels:
  23. tier: aihub-dag
  24. component: backendaf
  25. release: {{ .Release.Name }}
  26. date: "{{ now | unixEpoch }}"
  27. spec:
  28. {{- with .Values.backendaf.imagePullSecrets }}
  29. imagePullSecrets:
  30. {{- toYaml . | nindent 8 }}
  31. {{- end }}
  32. securityContext:
  33. {{- toYaml .Values.backendaf.podSecurityContext | nindent 8 }}
  34. containers:
  35. - name: {{ .Release.Name }}-backendaf
  36. env:
  37. - name: APP_ENV
  38. value: {{ .Values.backendaf.appEnv }}
  39. - name: APP_PREFIX
  40. value: af
  41. securityContext:
  42. {{- toYaml .Values.securityContext | nindent 12 }}
  43. image: "{{ .Values.backendaf.image.repository }}:{{ .Values.backendaf.image.tag | default .Chart.AppVersion }}"
  44. imagePullPolicy: {{ .Values.backendaf.image.pullPolicy }}
  45. ports:
  46. - name: http
  47. containerPort: {{ .Values.backendaf.service.port }}
  48. protocol: TCP
  49. volumeMounts:
  50. - name: airflow-logs
  51. mountPath: /logs
  52. - name: airflow-dags
  53. mountPath: /dags
  54. subPath: repo
  55. livenessProbe:
  56. initialDelaySeconds: 30
  57. periodSeconds: 5
  58. timeoutSeconds: 5
  59. failureThreshold: 3
  60. successThreshold: 1
  61. httpGet:
  62. path: /af/ping
  63. port: http
  64. readinessProbe:
  65. initialDelaySeconds: 30
  66. periodSeconds: 5
  67. timeoutSeconds: 5
  68. failureThreshold: 3
  69. successThreshold: 1
  70. httpGet:
  71. path: /af/ping
  72. port: http
  73. resources:
  74. {{- toYaml .Values.backendaf.resources | nindent 12 }}
  75. volumes:
  76. - name: airflow-dags
  77. persistentVolumeClaim:
  78. claimName: airflow-dags
  79. - name: airflow-logs
  80. persistentVolumeClaim:
  81. claimName: airflow-logs
  82. # livenessProbe:
  83. # httpGet:
  84. # path: /
  85. # port: http
  86. # readinessProbe:
  87. # httpGet:
  88. # path: /
  89. # port: http
  90. {{- with .Values.backendaf.nodeSelector }}
  91. nodeSelector:
  92. {{- toYaml . | nindent 8 }}
  93. {{- end }}
  94. {{- with .Values.backendaf.affinity }}
  95. affinity:
  96. {{- toYaml . | nindent 8 }}
  97. {{- end }}
  98. {{- with .Values.backendaf.tolerations }}
  99. tolerations:
  100. {{- toYaml . | nindent 8 }}
  101. {{- end }}