* k8s local deployment work: - make it easier to deploy w/o ingress by setting 'local_service_port' (suggested port 30870) - if using local minio, ensure file endpoints set to /data/ and /data/ proxies correctly to local bucket - if not using minio, ensure file endpoints point to correct access / endpoint url. - setup should work with docker desktop, minikube, microk8s and k3s! - nginx chart: bump nginx memory limit to 20Mi - nginx image: 00-default-override-resolver-config -> 00-browsertrix-nginx-init for clarity - nginx image: use default nginx.conf, pin to nginx 1.23.2 - mongo: readd readiness probe, bump connect wait timeout (needed for ci) - config: set superadmin username to 'admin' - config schema: set 'name' as required - add sample chart values overrides: - chart values: local-config.yaml for running locally with 'local_service_port' - chart values: add microk8s-hosted.yaml for configuring a hosted microk8s setup - chart values: add microk8s-ci.yaml for ci tests - ci: remove docker swarm tests - ci: add microk8s integration tests: launching cluster, logging in, running a crawl of example.com, downloading/checking WACZ - bump to 1.1.0-beta.2
107 lines
2.4 KiB
YAML
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.nginx_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.nginx_image }}
|
|
imagePullPolicy: {{ .Values.nginx_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.nginx_limits_cpu }}
|
|
memory: {{ .Values.nginx_limits_memory }}
|
|
|
|
requests:
|
|
cpu: {{ .Values.nginx_requests_cpu }}
|
|
memory: {{ .Values.nginx_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 }}
|
|
|