browsertrix/chart/templates/operators.yaml
Ilya Kreymer 7fa2b61b29
Execution time tracking tweaks (#1994)
Tweaks to how execution time is tracked for more accuracy + excluding
waiting states:
- don't update if crawl state is in a 'waiting state' (waiting for
capacity or waiting for org limit)
- rename start states -> waiting states for clarity
- reset lastUpdatedTime if two consecutive updates of non-running state,
to ensure non-running states don't count, but also account for
occasional hiccups -- if only one update detects non-running state,
don't reset
- webhooks: move start webhook to when crawl actually starts for first
time (db lastUpdatedTime is not yet + crawl is running)
- don't set lastUpdatedTime until pods actually running
- set crawljob update interval to every 10 seconds for more accurate
execution time tracking
- frontend: show seconds in 'Execution Time' display
2024-08-06 09:44:44 -07:00

136 lines
3.0 KiB
YAML

---
apiVersion: metacontroller.k8s.io/v1alpha1
kind: CompositeController
metadata:
name: crawljobs-operator
spec:
generateSelector: false
resyncPeriodSeconds: {{ .Values.operator_resync_seconds | default 10 }}
parentResource:
apiVersion: btrix.cloud/v1
resource: crawljobs
childResources:
- apiVersion: v1
resource: pods
updateStrategy:
method: OnDelete
- apiVersion: v1
resource: persistentvolumeclaims
updateStrategy:
method: InPlace
- apiVersion: v1
resource: configmaps
updateStrategy:
method: InPlace
hooks:
sync:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/crawls/sync
finalize:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/crawls/finalize
customize:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/crawls/customize
---
apiVersion: metacontroller.k8s.io/v1alpha1
kind: CompositeController
metadata:
name: profilejobs-operator
spec:
generateSelector: false
resyncPeriodSeconds: 30
parentResource:
apiVersion: btrix.cloud/v1
resource: profilejobs
childResources:
- apiVersion: v1
resource: pods
updateStrategy:
method: InPlace
hooks:
sync:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/profilebrowsers/sync
---
apiVersion: metacontroller.k8s.io/v1alpha1
kind: DecoratorController
metadata:
name: cron-crawljobs-operator
spec:
resyncPeriodSeconds: 60
resources:
- apiVersion: batch/v1
resource: jobs
labelSelector:
matchLabels:
role: scheduled-crawljob
attachments:
- apiVersion: btrix.cloud/v1
resource: crawljobs
updateStrategy:
method: OnDelete
hooks:
sync:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/cronjob/sync
---
apiVersion: metacontroller.k8s.io/v1alpha1
kind: DecoratorController
metadata:
name: background-job-operator
spec:
resyncPeriodSeconds: 60
resources:
- apiVersion: batch/v1
resource: jobs
labelSelector:
matchLabels:
role: background-job
hooks:
sync:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/backgroundjob/sync
finalize:
webhook:
service:
namespace: {{ .Release.Namespace }}
name: {{ .Values.name }}-backend
port: {{ .Values.opPort }}
path: /op/backgroundjob/finalize