diff --git a/chart/app-templates/crawler.yaml b/chart/app-templates/crawler.yaml index a85eac89..67d8c588 100644 --- a/chart/app-templates/crawler.yaml +++ b/chart/app-templates/crawler.yaml @@ -60,24 +60,28 @@ spec: claimName: {{ name }} affinity: +{% if crawler_node_type %} nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - preference: - matchExpressions: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: - key: nodeType operator: In values: - "{{ crawler_node_type }}" +{% endif %} podAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - weight: 2 + - weight: 10 podAffinityTerm: - topologyKey: "failure-domain.beta.kubernetes.io/zone" + topologyKey: "kubernetes.io/hostname" labelSelector: - matchLabels: - crawl: {{ id }} + matchExpressions: + - key: crawl + operator: In + values: + - {{ id }} tolerations: - key: nodeType diff --git a/chart/app-templates/profilebrowser.yaml b/chart/app-templates/profilebrowser.yaml index 828beefa..335f705c 100644 --- a/chart/app-templates/profilebrowser.yaml +++ b/chart/app-templates/profilebrowser.yaml @@ -18,16 +18,17 @@ spec: restartPolicy: OnFailure +{% if crawler_node_type %} affinity: nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - preference: - matchExpressions: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: - key: nodeType operator: In values: - "{{ crawler_node_type }}" +{% endif %} tolerations: - key: nodeType @@ -74,3 +75,11 @@ spec: - name: CHROME_FLAGS value: "--proxy-server=socks5://{{ crawler_socks_proxy_host }}:{{ crawler_socks_proxy_port | default('9050') }}" {% endif %} + + resources: + limits: + memory: "{{ crawler_memory }}" + + requests: + cpu: "{{ crawler_cpu }}" + memory: "{{ crawler_memory }}"