* 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
		
			
				
	
	
		
			110 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			110 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| apiVersion: batch/v1
 | |
| kind: Job
 | |
| metadata:
 | |
|   name: job-{{ id }}
 | |
|   annotations:
 | |
|     btrix.run.manual: "{{ manual }}"
 | |
| 
 | |
|   labels:
 | |
|     btrix.user: {{ userid }}
 | |
|     btrix.org: {{ oid }}
 | |
|     btrix.crawlconfig: {{ cid }}
 | |
| 
 | |
| spec:
 | |
|   backoffLimit: 1000
 | |
|   ttlSecondsAfterFinished: 20
 | |
|   template:
 | |
|     metadata:
 | |
|       labels:
 | |
|         btrix.user: {{ userid }}
 | |
|         btrix.org: {{ oid }}
 | |
|         btrix.crawlconfig: {{ cid }}
 | |
|     spec:
 | |
|       restartPolicy: OnFailure
 | |
|       affinity:
 | |
|         nodeAffinity:
 | |
|           preferredDuringSchedulingIgnoredDuringExecution:
 | |
|             - weight: 1
 | |
|               preference:
 | |
|                 matchExpressions:
 | |
|                 - key: nodeType
 | |
|                   operator: In
 | |
|                   values:
 | |
|                     - "{{ crawler_node_type }}"
 | |
| 
 | |
|       tolerations:
 | |
|         - key: "nodeType"
 | |
|           operator: "Equal"
 | |
|           value: "crawling"
 | |
|           effect: "NoSchedule"
 | |
| 
 | |
|       containers:
 | |
|         - name: crawl-job
 | |
|           image: {{ job_image }}
 | |
|           imagePullPolicy: {{ job_pull_policy }}
 | |
|           command: ["uvicorn", "btrixcloud.k8s.crawl_job:app", "--host", "0.0.0.0", "--access-log", "--log-level", "info"]
 | |
| 
 | |
|           volumeMounts:
 | |
|             - name: config-volume
 | |
|               mountPath: /config
 | |
| 
 | |
|           envFrom:
 | |
|             - secretRef:
 | |
|                 name: mongo-auth
 | |
| 
 | |
|           env:
 | |
|             - name: JOB_ID
 | |
|               valueFrom:
 | |
|                 fieldRef:
 | |
|                   fieldPath: metadata.labels['job-name']
 | |
| 
 | |
|             - name: RUN_MANUAL
 | |
|               value: "{{ manual }}"
 | |
| 
 | |
|             - name: USER_ID
 | |
|               value: "{{ userid }}"
 | |
| 
 | |
|             - name: ORG_ID
 | |
|               value: "{{ oid }}"
 | |
| 
 | |
|             - name: CRAWL_CONFIG_ID
 | |
|               value: "{{ cid }}"
 | |
| 
 | |
|             - name: TAGS
 | |
|               value: "{{ tags }}"
 | |
| 
 | |
|             - name: STORE_PATH
 | |
|               valueFrom:
 | |
|                 configMapKeyRef:
 | |
|                   name: crawl-config-{{ cid }}
 | |
|                   key: STORE_PATH
 | |
| 
 | |
|             - name: STORE_FILENAME
 | |
|               valueFrom:
 | |
|                 configMapKeyRef:
 | |
|                   name: crawl-config-{{ cid }}
 | |
|                   key: STORE_FILENAME
 | |
| 
 | |
|             - name: STORAGE_NAME
 | |
|               valueFrom:
 | |
|                 configMapKeyRef:
 | |
|                   name: crawl-config-{{ cid }}
 | |
|                   key: STORAGE_NAME
 | |
| 
 | |
|             - name: PROFILE_FILENAME
 | |
|               valueFrom:
 | |
|                 configMapKeyRef:
 | |
|                   name: crawl-config-{{ cid }}
 | |
|                   key: PROFILE_FILENAME
 | |
| 
 | |
|       volumes:
 | |
|         - name: config-volume
 | |
|           configMap:
 | |
|             name: shared-job-config
 | |
|             items:
 | |
|               - key: config.yaml
 | |
|                 path: config.yaml
 | |
|             
 | |
| 
 | |
| 
 |