1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-backoffice-v1-monolith/charts/backoffice/templates/deployment.yaml
Vojtech Mares 0f7fee21e0
fix(helm): difference between preferred... and required...
- preferred (soft) pod (anti) affinity has weights and podAffinityTerm, required does not
- required (hard) pod (anti) affinity has directly array with labelSelector (no weight and no podAffinityTerm)
2023-09-03 14:11:21 +02:00

68 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: backend
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: backend
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: backend
spec:
{{- if .Values.dockerconfigjsonBase64 }}
imagePullSecrets:
- name: {{ .Release.Name }}-container-registry
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: Always
ports:
- name: {{ .Values.service.portName }}
containerPort: {{ .Values.service.portNumber }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: {{ .Values.service.portName }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.service.portName }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
- secretRef:
name: {{ .Release.Name }}-database
- secretRef:
name: {{ .Release.Name }}-nextauth
resources:
{{- toYaml .Values.backend.resources | nindent 12 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
topologyKey: kubernetes.io/hostname