_containers.tpl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{/*
  2. Container Command
  3. */}}
  4. {{- define "containerCommand" }}
  5. {{- if .Values.containerCommand }}
  6. command:
  7. {{- range .Values.containerCommand }}
  8. - {{ . | quote}}
  9. {{- end }}
  10. {{- end }}
  11. {{- end }}
  12. {{/*
  13. Container Args
  14. */}}
  15. {{- define "containerArgs" }}
  16. {{- if .Values.containerArgs }}
  17. args:
  18. {{- range .Values.containerArgs }}
  19. - {{ . | quote}}
  20. {{- end }}
  21. {{- end }}
  22. {{- end }}
  23. {{/*
  24. Container Environment Variables
  25. */}}
  26. {{- define "containerEnvVariables" }}
  27. {{- if .Values.containerEnvironmentVariables }}
  28. env:
  29. {{- range .Values.containerEnvironmentVariables }}
  30. - name: {{ .name | quote }}
  31. value: {{ .value | quote }}
  32. {{- end }}
  33. {{- end }}
  34. {{- end }}
  35. {{/*
  36. Container Liveness Probe
  37. */}}
  38. {{- define "containerLivenssProbe" }}
  39. {{- if .Values.livenessProbe }}
  40. livenessProbe:
  41. exec:
  42. command:
  43. {{ toYaml .Values.livenessProbe.command | indent 16 }}
  44. initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
  45. periodSeconds: {{ .Values.periodSeconds }}
  46. {{- end }}
  47. {{- end }}
  48. {{/*
  49. Container Ports
  50. */}}
  51. {{- define "containerPorts" }}
  52. {{- if or .Values.portForwardingList .Values.hostPortsList }}
  53. ports:
  54. {{- range $index, $config := .Values.portForwardingList }}
  55. - containerPort: {{ $config.containerPort }}
  56. {{- end }}
  57. {{- range $index, $config := .Values.hostPortsList }}
  58. - containerPort: {{ $config.containerPort }}
  59. hostPort: {{ $config.hostPort }}
  60. {{- end }}
  61. {{- end }}
  62. {{- end }}