Skip to content

How to use spot instances

Imported from Confluence

Content may be outdated. Verify before following any procedures. View original | Last updated: December 2022

In order to run workloads on spot instances update chart with following toleration and affinity rules:

tolerations:
  - key: cloud.google.com/gke-spot
    operator: Equal
    value: "true"
    effect: NoSchedule

affinity:
  nodeAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 1
      preference:
        matchExpressions:
        - key: cloud.google.com/gke-spot
          operator: In
          values:
          - "true"

Normally only kind: Deployment or kind: Pod need to be updated.