browsertrix/chart/templates/frontend.yaml
Ilya Kreymer f1fd11c031
storage: use s3v4 signature for presigning urls (#2611)
Use V4 ('s3v4') signature version for for all presigning URLs to support
backblaze, fixes #2472
- add 'access_addressing_style' to be able to choose virtual/path
addressing for access endpoint (default to 'virtual' as before)
- fix minio presigning with v4 by using 'path' addressing style for
minio
- if path matches '/data/' for internal minio bucket, then always use
'path'
- also make minio access path '/data/' configurable

also simplify running in any namespace with default settings:
- don't hardcode 'local-minio.default'
- in crawlers namespace, add a 'local-minio' externalName service which
maps to the main namespace service.
2025-05-19 15:44:36 -07:00

155 lines
3.6 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}-frontend
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ .Values.name }}
role: frontend
{{- if eq (int .Values.frontend_max_replicas) 1 }}
replicas: 1
{{- end }}
template:
metadata:
labels:
app: {{ .Values.name }}
role: frontend
annotations:
# force helm to update the deployment each time
{{- if not .Values.backend_only }}
"helm.update": {{ randAlphaNum 5 | quote }}
{{- end }}
spec:
{{- if .Values.main_node_type }}
nodeSelector:
nodeType: {{ .Values.main_node_type }}
{{- end }}
containers:
- name: nginx
image: {{ .Values.frontend_image }}
imagePullPolicy: {{ .Values.frontend_pull_policy }}
env:
- name: BACKEND_HOST
value: {{ .Values.name }}-backend
- name: CRAWLER_FQDN_SUFFIX
value: ".{{ .Values.crawler_namespace }}{{ .Values.fqdn_suffix }}"
- name: NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE
value: "1"
- name: RWP_BASE_URL
value: {{ .Values.rwp_base_url }}
{{- if .Values.docs_url }}
- name: DOCS_URL
value: {{ .Values.docs_url }}
{{- end }}
{{- if .Values.minio_local }}
- name: LOCAL_MINIO_HOST
value: "{{ .Values.minio_host }}"
- name: LOCAL_BUCKET
value: "{{ .Values.minio_local_bucket_name }}"
- name: LOCAL_ACCESS_PATH
value: "{{ .Values.minio_access_path }}"
{{- end }}
{{- if .Values.inject_extra }}
- name: INJECT_EXTRA
value: {{ .Values.inject_extra }}
{{- end }}
resources:
limits:
memory: {{ .Values.frontend_memory }}
requests:
cpu: {{ .Values.frontend_cpu }}
memory: {{ .Values.frontend_memory }}
readinessProbe:
httpGet:
path: /healthz
port: 8880
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
---
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-frontend
labels:
app: {{ .Values.name }}
role: frontend
{{- 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: frontend
ports:
- protocol: TCP
port: 80
name: frontend
{{- if and .Values.local_service_port (not .Values.ingress.host) }}
nodePort: {{ .Values.local_service_port }}
type: NodePort
{{- end }}
{{- if gt (int .Values.frontend_max_replicas) 1 }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: frontend-autoscaler
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.name }}-frontend
minReplicas: 1
maxReplicas: {{ .Values.frontend_max_replicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.frontend_avg_cpu_threshold }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.frontend_avg_memory_threshold }}
{{ end }}