* misc backend fixes: - fix running w/o local minio - ensure crawler image pull policy is configurable, loaded via chart value - use digitalocean repo for main backend image (for now) - add bucket_name to config only if using default bucket * enable all behaviors, support 'access_endpoint_url' for default storages * debugging: add 'no_delete_jobs' setting for k8s and docker to disable deletion of completed jobs
144 lines
3.4 KiB
YAML
144 lines
3.4 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Values.name }}
|
|
namespace: {{ .Release.Namespace }}
|
|
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Values.name }}
|
|
replicas: {{ .Values.api_num_replicas }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ .Values.name }}
|
|
|
|
annotations:
|
|
# force helm to update the deployment each time
|
|
"helm.update": {{ randAlphaNum 5 | quote }}
|
|
|
|
spec:
|
|
volumes:
|
|
- name: nginx-config
|
|
configMap:
|
|
name: nginx-config
|
|
items:
|
|
- key: nginx.conf
|
|
path: nginx.conf
|
|
|
|
- name: nginx-resolver
|
|
emptyDir: {}
|
|
|
|
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 }}
|
|
|
|
- name: init-nginx
|
|
image: {{ .Values.nginx_image }}
|
|
command: ["/bin/sh"]
|
|
args: ["-c", "echo resolver $(awk 'BEGIN{ORS=\" \"} $1==\"nameserver\" {print $2}' /etc/resolv.conf) valid=30s \";\" > /etc/nginx/resolvers/resolvers.conf"]
|
|
volumeMounts:
|
|
- name: nginx-resolver
|
|
mountPath: /etc/nginx/resolvers/
|
|
|
|
|
|
containers:
|
|
- name: nginx
|
|
image: {{ .Values.nginx_image }}
|
|
imagePullPolicy: {{ .Values.nginx_pull_policy }}
|
|
volumeMounts:
|
|
- name: nginx-config
|
|
mountPath: /etc/nginx/nginx.conf
|
|
subPath: nginx.conf
|
|
readOnly: true
|
|
|
|
- name: nginx-resolver
|
|
mountPath: /etc/nginx/resolvers/
|
|
readOnly: true
|
|
|
|
resources:
|
|
limits:
|
|
cpu: {{ .Values.nginx_limit_cpu }}
|
|
|
|
requests:
|
|
cpu: {{ .Values.nginx_requests_cpu }}
|
|
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: 80
|
|
|
|
|
|
- name: api
|
|
image: {{ .Values.api_image }}
|
|
imagePullPolicy: {{ .Values.api_pull_policy }}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: {{ .Values.name }}-env-config
|
|
- secretRef:
|
|
name: auth-secrets
|
|
|
|
resources:
|
|
limits:
|
|
cpu: {{ .Values.api_limits_cpu }}
|
|
memory: {{ .Values.api_limits_memory }}
|
|
|
|
requests:
|
|
cpu: {{ .Values.api_requests_cpu }}
|
|
memory: {{ .Values.api_requests_memory }}
|
|
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: 8000
|
|
---
|
|
|
|
apiVersion: v1
|
|
kind: Service
|
|
|
|
metadata:
|
|
namespace: {{ .Release.Namespace }}
|
|
name: {{ .Values.name }}
|
|
labels:
|
|
app: {{ .Values.name }}
|
|
|
|
{{- 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 }}
|
|
|
|
{{- if .Values.service }}
|
|
{{- if .Values.service.type }}
|
|
type: {{ .Values.service.type | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
ports:
|
|
- protocol: TCP
|
|
port: 80
|
|
name: api
|
|
#externalIPs:
|
|
# - 127.0.0.1
|