deployment.yaml 1.9 KB

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