containers: - name: {{ .Values.applicationName }} image: {{ .Values.imageRegistry }}/{{…
- User
containers: - name: {{ .Values.applicationName }} image: {{ .Values.imageRegistry }}/{{ .Values.imageRepository }}:{{ .Values.imageTag }} resources: limits: cpu: {{ .Values.resources.limits.cpu }} memory: {{ .Values.resources.limits.memory }} requests: cpu: {{ .Values.resources.requests.cpu }} memory: {{ .Values.resources.requests.memory }} env: {{- range val := .Values.env }} - name: "{{ key }}" value: "{{ val }}" {{- end}} volumeMounts: - name: config mountPath: /app/appsettings.json subPath: appsettings.json {{- if .Values.route }} lifecycle: preStop: exec: command: - sleep - '{{ ((.Values.lifecycle).preStop).sleepSeconds | default 30 }}' {{- end }}
- Assistant
This is a template for defining a container within a Kubernetes manifest file. The template includes parameters for the container's name, image, resource limits and requests, environment variables, volume mounts, and lifecycle configurations.
The
{{ .Values.applicationName }},{{ .Values.imageRegistry }},{{ .Values.imageRepository }},{{ .Values.imageTag }},{{ .Values.resources.limits.cpu }},{{ .Values.resources.limits.memory }},{{ .Values.resources.requests.cpu }}, and{{ .Values.resources.requests.memory }}are placeholders that will be replaced with actual values when the template is processed.The
{{- range $key,$val := .Values.env }}block is used to loop through environment variables defined in thevalues.yamlfile and set them for the container.The section specifies a volume mount for the container, mounting the volume at with a subPath of .