86 lines
3.2 KiB
YAML
86 lines
3.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "reuse.fullname" . }}
|
|
labels:
|
|
{{- include "reuse.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: api
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels: {{- include "reuse.selectorLabels" . | nindent 6 }}
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "reuse.selectorLabels" . | nindent 8 }}
|
|
app.kubernetes.io/component: api
|
|
spec:
|
|
enableServiceLinks: false
|
|
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: reuse-surface
|
|
image: {{ include "reuse.image" . | quote }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command: ["reuse-surface", "serve"]
|
|
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.service.targetPort }}
|
|
protocol: TCP
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ .Values.envSecretName | quote }}
|
|
env:
|
|
- name: REUSE_SURFACE_LISTEN_HOST
|
|
value: "0.0.0.0"
|
|
- name: REUSE_SURFACE_LISTEN_PORT
|
|
value: {{ .Values.service.targetPort | quote }}
|
|
- name: REUSE_SURFACE_DB
|
|
value: {{ printf "%s/reuse.db" .Values.persistence.mountPath | quote }}
|
|
- name: REUSE_SURFACE_CACHE_DIR
|
|
value: {{ printf "%s/cache" .Values.persistence.mountPath | quote }}
|
|
{{- if .Values.persistence.enabled }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- end }}
|
|
{{- if .Values.probes.enabled }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: {{ .Values.probes.path }}
|
|
port: {{ .Values.probes.port }}
|
|
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: {{ .Values.probes.path }}
|
|
port: {{ .Values.probes.port }}
|
|
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
|
|
{{- end }}
|
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
|
{{- if .Values.persistence.enabled }}
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "reuse.fullname" . }}-data
|
|
{{- 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 }}
|