_containers.tpl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 }}
  63. {{/*
  64. Container Resource Configuration
  65. */}}
  66. {{- define "containerResourceConfiguration" }}
  67. {{- if .Values.gpuConfiguration }}
  68. resources:
  69. limits:
  70. {{- toYaml .Values.gpuConfiguration | nindent 4 }}
  71. {{- end }}
  72. {{- end }}