Hangar/chart/templates/deployment-backend.yaml

83 lines
2.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hangar.fullname" . }}-backend
labels:
{{- include "hangar.labels" . | nindent 4 }}
spec:
{{- if not .Values.backend.autoscaling.enabled }}
replicas: {{ .Values.backend.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "hangar.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: "backend"
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secret-hangar-backend.yaml") . | sha256sum }}
{{- with .Values.backend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "hangar.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: "backend"
spec:
{{- with .Values.backend.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "hangar.backend.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.backend.podSecurityContext | nindent 8 }}
volumes:
- name: {{ include "hangar.fullname" . }}-backend-config-volume
secret:
secretName: {{ include "hangar.fullname" . }}-backend
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.backend.securityContext | nindent 12 }}
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: management
containerPort: 8081
protocol: TCP
env:
- name: spring.config.location
value: "classpath:/application.yml,/hangar/config/application.yaml"
volumeMounts:
- name: {{ include "hangar.fullname" . }}-backend-config-volume
mountPath: /hangar/config
readOnly: true
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: management
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: management
initialDelaySeconds: 5
periodSeconds: 5
resources:
{{- toYaml .Values.backend.resources | nindent 12 }}
{{- with .Values.backend.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.backend.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.backend.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}