75 lines
2.5 KiB
YAML
75 lines
2.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: "{{ .Chart.Name }}"
|
|
stand: "{{ .Values.stand }}"
|
|
name: "{{ .Chart.Name }}"
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: "{{ .Chart.Name }}"
|
|
stand: "{{ .Values.stand }}"
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: "{{ .Chart.Name }}"
|
|
stand: "{{ .Values.stand }}"
|
|
spec:
|
|
{{- if .Values.vault.enabled }}
|
|
serviceAccountName: "{{ .Values.vault.serviceAccountName }}"
|
|
{{- end }}
|
|
containers:
|
|
# Основное приложение
|
|
- name: app
|
|
image: "{{ .Values.mainContainer.image.repository }}:{{ .Values.mainContainer.image.tag }}"
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: {{ .Values.mainContainer.containerPort }}
|
|
protocol: TCP
|
|
resources:
|
|
{{- toYaml .Values.mainContainer.resources | nindent 12 }}
|
|
readinessProbe:
|
|
failureThreshold: 3
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
successThreshold: 1
|
|
timeoutSeconds: 2
|
|
{{- toYaml .Values.mainContainer.readinessProbe | nindent 12 }}
|
|
livenessProbe:
|
|
failureThreshold: 3
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 1
|
|
{{- toYaml .Values.mainContainer.livenessProbe | nindent 12 }}
|
|
{{- if .Values.vault.enabled }}
|
|
envFrom:
|
|
- secretRef:
|
|
name: "{{ .Values.vault.target.name }}"
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- toYaml .Values.mainContainer.volumeMounts | nindent 12 }}
|
|
|
|
# Sidecar-контейнеры
|
|
{{- if .Values.sidecars.logger.enabled }}
|
|
- name: logger
|
|
image: "{{ .Values.sidecars.logger.image.repository }}:{{ .Values.sidecars.logger.image.tag }}"
|
|
imagePullPolicy: IfNotPresent
|
|
resources:
|
|
{{- toYaml .Values.sidecars.logger.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: fluentbit-config
|
|
mountPath: /fluent-bit/etc/
|
|
{{- toYaml .Values.sidecars.logger.volumeMounts | nindent 12 }}
|
|
{{- end }}
|
|
|
|
volumes:
|
|
{{- if .Values.sidecars.logger.enabled }}
|
|
- name: fluentbit-config
|
|
configMap:
|
|
name: fluentbit-{{ .Chart.Name }}
|
|
{{- end }}
|
|
{{- toYaml .Values.mainContainer.volumes | nindent 8 }}
|