* profile browser vnc support + fixes: - switch profile browser rendering to use VNC - frontend: add @novnc/novnc as dependency, create separate bundle novnc.js to load into vnc browser (to avoid loading from each container) - frontend: update proxy paths to proxy websocket, index page to crawler - frontend: allow browser profiles in all browsers, remove browser compatibility check - frontend: update webpack dev config, apply prettier - frontend: node version fix - backend: get vncpassword, build new URL for proxying to crawler iframe - backend: fix profile / crawl job pull policy from 'Always' -> 'Never', should use existing image for job - backend: fix kill signal to use bash -c to work with latest backend image - backend/chart: add 'profile_browser_timeout_seconds' to chart values to control how long profile browser to remain when idle (default to 60) - backend: remove utils.py, now using secret.token_hex() for random suffix Co-authored-by: sua yoo <sua@suayoo.com>
		
			
				
	
	
		
			105 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			105 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| ---
 | |
| apiVersion: apps/v1
 | |
| kind: StatefulSet
 | |
| metadata:
 | |
|   name: browser-{{ id }}
 | |
|   namespace: {{ namespace }}
 | |
|   labels:
 | |
|     browser: {{ id }}
 | |
|     role: browser
 | |
| 
 | |
| spec:
 | |
|   selector:
 | |
|     matchLabels:
 | |
|       browser: {{ id }}
 | |
|       role: browser
 | |
| 
 | |
|   serviceName: browser-{{ id }}
 | |
|   replicas: 1
 | |
| 
 | |
|   template:
 | |
|     metadata:
 | |
|       labels:
 | |
|         browser: {{ id }}
 | |
|         role: browser
 | |
| 
 | |
|     spec:
 | |
|       affinity:
 | |
|         nodeAffinity:
 | |
|           preferredDuringSchedulingIgnoredDuringExecution:
 | |
|             - weight: 1
 | |
|               preference:
 | |
|                 matchExpressions:
 | |
|                 - key: nodeType
 | |
|                   operator: In
 | |
|                   values:
 | |
|                     - "{{ crawler_node_type }}"
 | |
| 
 | |
|         podAffinity:
 | |
|           preferredDuringSchedulingIgnoredDuringExecution:
 | |
|             - weight: 2
 | |
|               podAffinityTerm:
 | |
|                 topologyKey: "failure-domain.beta.kubernetes.io/zone"
 | |
|                 labelSelector:
 | |
|                   matchLabels:
 | |
|                     job-name: job-{{ id }}
 | |
|                     crawl: {{ id }}
 | |
| 
 | |
|       tolerations:
 | |
|         - key: "nodeType"
 | |
|           operator: "Equal"
 | |
|           value: "crawling"
 | |
|           effect: "NoSchedule"
 | |
| 
 | |
|       containers:
 | |
|         - name: browser
 | |
|           image: {{ crawler_image }}
 | |
|           imagePullPolicy: {{ crawler_image_pull_policy }}
 | |
|           command:
 | |
|             - create-login-profile
 | |
|             - --interactive
 | |
|             - --filename
 | |
|             - /tmp/profile.tar.gz
 | |
|             - --url
 | |
|             - {{ url }}
 | |
|           {%- if profile_filename %}
 | |
|             - --profile
 | |
|             - "@{{ profile_filename }}"
 | |
|           {%- endif %}   
 | |
| 
 | |
|           envFrom:
 | |
|             - secretRef:
 | |
|                 name: storage-{{ storage_name }}
 | |
| 
 | |
|           env:
 | |
|             - name: STORE_PATH
 | |
|               value: {{ storage_path }}
 | |
| 
 | |
|             - name: VNC_PASS
 | |
|               value: {{ vnc_password }}
 | |
| 
 | |
| ---
 | |
| apiVersion: v1
 | |
| kind: Service
 | |
| metadata:
 | |
|   name: browser-{{ id }}
 | |
|   labels:
 | |
|     browser: {{ id }}
 | |
|     role: browser
 | |
|  
 | |
| spec:
 | |
|   clusterIP: None
 | |
|   selector:
 | |
|     browser: {{ id }}
 | |
|     role: browser
 | |
| 
 | |
|   ports:
 | |
|     - protocol: TCP
 | |
|       port: 9223
 | |
|       name: browser-api
 | |
| 
 | |
|     - protocol: TCP
 | |
|       port: 9222
 | |
|       name: browser-ws
 | |
| 
 |