browsertrix/chart/templates/backend.yaml
Ilya Kreymer 3df310ee4f
Backend: Crawls with Multiple WACZ files + Profile + Misc Fixes (#232)
* backend: k8s:
- support crawls with multiple wacz files, don't assume crawl complete after first wacz uploaded
- if crawl is running and has wacz file, still show as running
- k8s: allow configuring node selector for main pods (eg. nodeType=main) and for crawlers (eg. nodeType=crawling)
- profiles: support uploading to alternate storage specified via 'shared_profile_storage' value is set
- misc fixes for profiles

* backend: ensure docker run_profile api matches k8s
k8s chart: don't delete pvc and pv in helm chart

* dependency: bump authsign to 0.4.0
docker: disable public redis port

* profiles: fix path, profile browser return value

* fix typo in presigned url cacheing
2022-05-19 18:40:41 -07:00

131 lines
3.0 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}-backend
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ .Values.name }}
role: backend
replicas: {{ .Values.api_num_replicas }}
template:
metadata:
labels:
app: {{ .Values.name }}
role: backend
annotations:
# force helm to update the deployment each time
{{- if not .Values.frontend_only }}
"helm.update": {{ randAlphaNum 5 | quote }}
{{- end }}
spec:
{{- if .Values.main_node_type }}
nodeSelector:
nodeType: {{ .Values.main_node_type }}
{{- end }}
initContainers:
{{- if .Values.minio_local }}
- name: init-bucket
image: {{ .Values.minio_mc_image }}
imagePullPolicy: {{ .Values.minio_pull_policy }}
env:
- name: MC_HOST_local
valueFrom:
secretKeyRef:
name: auth-secrets
key: MC_HOST
command: ['/bin/sh']
args: ['-c', 'mc mb --ignore-existing local/{{ .Values.minio_local_bucket_name }}' ]
{{- end }}
containers:
- name: api
image: {{ .Values.api_image }}
imagePullPolicy: {{ .Values.api_pull_policy }}
envFrom:
- configMapRef:
name: {{ .Values.name }}-env-config
- secretRef:
name: auth-secrets
- secretRef:
name: mongo-auth
resources:
limits:
cpu: {{ .Values.api_limits_cpu }}
memory: {{ .Values.api_limits_memory }}
requests:
cpu: {{ .Values.api_requests_cpu }}
memory: {{ .Values.api_requests_memory }}
startupProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 20
periodSeconds: 5
failureThreshold: 30
readinessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 15
periodSeconds: 30
failureThreshold: 5
livenessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 15
periodSeconds: 30
failureThreshold: 5
---
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
labels:
app: {{ .Values.name }}
role: backend
{{- if .Values.service }}
{{- if .Values.service.annotations }}
annotations:
{{- range $key, $val := .Values.service.annotations }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
selector:
app: {{ .Values.name }}
role: backend
{{- if .Values.service }}
{{- if .Values.service.type }}
type: {{ .Values.service.type | quote }}
{{- end }}
{{- end }}
ports:
- protocol: TCP
port: 8000
name: api