browsertrix/chart/templates/frontend.yaml
Ilya Kreymer ccd87e0dff
Rename api / nginx settings -> backend / frontend, set pull policy job images (#504)
* rename config values
- api -> backend
- nginx -> frontend

* job pods:
- set job_pull_policy from api_pull_policy (same as backend image)
- default to Always, but can be overridden for local deployment (same as backend image)

typo fix: CRAWL_NAMESPACE -> CRAWLER_NAMESPACE (part of #491)
ansible: set default label to :latest instead of :dev for
2023-01-18 20:21:36 -08:00

107 lines
2.4 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}-frontend
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ .Values.name }}
role: frontend
replicas: {{ .Values.frontend_num_replicas | default 1 }}
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 }}.svc.cluster.local"
- name: CRAWLER_SVC_SUFFIX
value: ".crawl-$crawl"
{{- if .Values.minio_local }}
- name: LOCAL_MINIO_HOST
value: "{{ .Values.minio_host }}"
- name: LOCAL_BUCKET
value: "{{ .Values.minio_local_bucket_name }}"
{{- end }}
resources:
limits:
cpu: {{ .Values.frontend_limits_cpu }}
memory: {{ .Values.frontend_limits_memory }}
requests:
cpu: {{ .Values.frontend_requests_cpu }}
memory: {{ .Values.frontend_requests_memory }}
readinessProbe:
httpGet:
path: /
port: 80
---
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
{{- if .Values.local_service_port }}
type: NodePort
{{- end }}
ports:
- protocol: TCP
port: 80
name: frontend
{{- if .Values.local_service_port }}
nodePort: {{ .Values.local_service_port }}
{{- end }}