- use statefulsets instead of deployments for mongo, redis, signer - use k8s job + statefulset for running crawls - use separate statefulset for crawl (scaled) and single-replica redis stateful set - move crawl job update login to crawl_updater - remove shared redis chart package refactor: - move to shared code to 'btrixcloud' - move k8s to 'btrixcloud.k8s' - move docker to 'btrixcloud.docker'
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
generateName: job-profile-browser-
|
|
|
|
labels:
|
|
btrix.profile: "1"
|
|
btrix.archive: {{ aid }}
|
|
btrix.user: {{ userid }}
|
|
{%- if baseprofile %}
|
|
btrix.baseprofile: "{{ baseprofile }}"
|
|
{%- endif %}
|
|
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
btrix.profile: "1"
|
|
btrix.archive: {{ aid }}
|
|
btrix.user: {{ userid }}
|
|
{%- if baseprofile %}
|
|
btrix.baseprofile: "{{ baseprofile }}"
|
|
{%- endif %}
|
|
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: crawl-job
|
|
image: {{ job_image }}
|
|
imagePullPolicy: Always
|
|
command: ["python", "-m", "btrixcloud.k8s.profile_job"]
|
|
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /config
|
|
|
|
env:
|
|
- name: JOB_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.labels['job-name']
|
|
|
|
- name: STORAGE_PATH
|
|
value: {{ storage_path }}
|
|
|
|
- name: STORAGE_NAME
|
|
value: {{ storage_name }}
|
|
|
|
- name: IDLE_TIMEOUT
|
|
value: "60"
|
|
|
|
- name: START_URL
|
|
value: {{ url }}
|
|
|
|
- name: PROFILE_PATH
|
|
value: {{ profile_path }}
|
|
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: shared-job-config
|
|
items:
|
|
- key: config.yaml
|
|
path: config.yaml
|
|
|