* 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
		
			
				
	
	
		
			84 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			84 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| apiVersion: batch/v1
 | |
| kind: Job
 | |
| metadata:
 | |
|   name: "job-{{ id }}"
 | |
| 
 | |
|   labels:
 | |
|     btrix.profile: "1"
 | |
|     btrix.org: {{ oid }}
 | |
|     btrix.user: {{ userid }}
 | |
|     {%- if baseprofile %}
 | |
|     btrix.baseprofile: "{{ baseprofile }}"
 | |
|     {%- endif %}
 | |
| 
 | |
| spec:
 | |
|   template:
 | |
|     metadata:
 | |
|       labels:
 | |
|         btrix.profile: "1"
 | |
|         btrix.org: {{ oid }}
 | |
|         btrix.user: {{ userid }}
 | |
|         {%- if baseprofile %}
 | |
|         btrix.baseprofile: "{{ baseprofile }}"
 | |
|         {%- endif %}
 | |
| 
 | |
|     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: ["python", "-m", "btrixcloud.k8s.profile_job"]
 | |
| 
 | |
|           volumeMounts:
 | |
|             - name: config-volume
 | |
|               mountPath: /config
 | |
| 
 | |
|           env:
 | |
|             - name: JOB_ID
 | |
|               valueFrom:
 | |
|                 fieldRef:
 | |
|                   fieldPath: metadata.labels['job-name']
 | |
| 
 | |
|             - name: STORE_PATH
 | |
|               value: {{ storage_path }}
 | |
| 
 | |
|             - name: STORAGE_NAME
 | |
|               value: {{ storage_name }}
 | |
| 
 | |
|             - name: IDLE_TIMEOUT
 | |
|               value: "{{ idle_timeout }}"
 | |
| 
 | |
|             - 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
 | |
|  
 |