deployment.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "helm-guestbook.fullname" . }}
  5. labels:
  6. app: {{ template "helm-guestbook.name" . }}
  7. chart: {{ template "helm-guestbook.chart" . }}
  8. release: {{ .Release.Name }}
  9. heritage: {{ .Release.Service }}
  10. spec:
  11. replicas: {{ .Values.replicaCount }}
  12. revisionHistoryLimit: 3
  13. selector:
  14. matchLabels:
  15. app: {{ template "helm-guestbook.name" . }}
  16. release: {{ .Release.Name }}
  17. template:
  18. metadata:
  19. labels:
  20. app: {{ template "helm-guestbook.name" . }}
  21. release: {{ .Release.Name }}
  22. spec:
  23. containers:
  24. - name: {{ .Chart.Name }}
  25. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  26. imagePullPolicy: {{ .Values.image.pullPolicy }}
  27. ports:
  28. - name: http
  29. containerPort: {{ .Values.containerPort }}
  30. protocol: TCP
  31. livenessProbe:
  32. httpGet:
  33. path: /
  34. port: http
  35. readinessProbe:
  36. httpGet:
  37. path: /
  38. port: http
  39. resources:
  40. {{ toYaml .Values.resources | indent 12 }}
  41. {{- with .Values.nodeSelector }}
  42. nodeSelector:
  43. {{ toYaml . | indent 8 }}
  44. {{- end }}
  45. {{- with .Values.affinity }}
  46. affinity:
  47. {{ toYaml . | indent 8 }}
  48. {{- end }}
  49. {{- with .Values.tolerations }}
  50. tolerations:
  51. {{ toYaml . | indent 8 }}
  52. {{- end }}