Files
helm-myapp-cloud/templates/deployment.yaml
T
domrichardson fc4298fc94 blah
2026-05-20 10:16:24 +01:00

112 lines
4.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "my-app.fullname" . }}
labels:
{{- include "my-app.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
minReadySeconds: {{ .Values.minReadySeconds }}
selector:
matchLabels:
{{- include "my-app.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "my-app.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "my-app.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-container1
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.container1.image.repository }}:{{ .Values.container1.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.container1.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.container1.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: {{ .Chart.Name }}-container2
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.container2.image.repository }}:{{ .Values.container2.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.container2.image.pullPolicy }}
ports:
- name: http2
containerPort: {{ .Values.container2.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: nginx-config-container2
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
- name: {{ .Chart.Name }}-container3
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.container3.image.repository }}:{{ .Values.container3.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.container3.image.pullPolicy }}
ports:
- name: http3
containerPort: {{ .Values.container3.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: nginx-config-container3
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: nginx-config-container2
configMap:
name: {{ .Release.Name }}-nginx-container2
- name: nginx-config-container3
configMap:
name: {{ .Release.Name }}-nginx-container3
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}