deployment.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ .Values.app.name }}
  5. labels:
  6. app: {{ .Values.app.name }}
  7. spec:
  8. replicas: {{ .Values.app.replicaCount }}
  9. selector:
  10. matchLabels:
  11. app: {{ .Values.app.name }}
  12. template:
  13. metadata:
  14. labels:
  15. app: {{ .Values.app.name }}
  16. {{- with .Values.podAnnotations }}
  17. annotations:
  18. {{- toYaml . | nindent 8 }}
  19. {{- end }}
  20. spec:
  21. {{- with .Values.securityContext }}
  22. securityContext:
  23. {{- toYaml . | nindent 8 }}
  24. {{- end }}
  25. containers:
  26. - name: {{ .Values.app.name }}
  27. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  28. imagePullPolicy: {{ .Values.image.pullPolicy }}
  29. ports:
  30. - name: http
  31. containerPort: {{ .Values.service.targetPort }}
  32. protocol: TCP
  33. volumeMounts:
  34. - name: config-volume
  35. mountPath: /etc/config
  36. readOnly: true
  37. env:
  38. - name: JAVA_OPTS
  39. value: "-Xmx512m -Xms256m"
  40. {{- with .Values.resources }}
  41. resources:
  42. {{- toYaml . | nindent 12 }}
  43. {{- end }}
  44. livenessProbe:
  45. httpGet:
  46. path: /actuator/health
  47. port: http
  48. initialDelaySeconds: 30
  49. periodSeconds: 10
  50. readinessProbe:
  51. httpGet:
  52. path: /actuator/health
  53. port: http
  54. initialDelaySeconds: 5
  55. periodSeconds: 5
  56. volumes:
  57. - name: config-volume
  58. configMap:
  59. name: {{ .Values.app.name }}-config
  60. {{- with .Values.nodeSelector }}
  61. nodeSelector:
  62. {{- toYaml . | nindent 8 }}
  63. {{- end }}
  64. {{- with .Values.affinity }}
  65. affinity:
  66. {{- toYaml . | nindent 8 }}
  67. {{- end }}
  68. {{- with .Values.tolerations }}
  69. tolerations:
  70. {{- toYaml . | nindent 8 }}
  71. {{- end }}