gke - using spot in autopilot mode

In you're managing your cluster, you can create a nodepool with spot instance. If you're using autopilot, then you need to make some changes to your deployment yaml.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: spot-pod-example
spec:
  replicas: 2
  selector:
    matchLabels:
      app: spot-app
  template:
    metadata:
      labels:
        app: spot-app
    spec:
      #priorityClassName: gke-spottable  # Enables Spot pricing - this didn't work
      nodeSelector:
        cloud.google.com/gke-spot: "true"
      terminationGracePeriodSeconds: 15
      containers:
      - name: my-container
        image: nginx

Once you have applied this to your cluster then you can see similiar output if you do a  kubectl get pod -o wide. the spot pod are running on a different node. 


More references can be found here:-

https://cloud.google.com/kubernetes-engine/docs/how-to/autopilot-spot-pods#request-spot-pods





Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type