Spotinst labels allow you to adjust the default behavior of scaling in Ocean, by adding Spotinst labels to your pods you can control the node termination process or its life cycle.
|Label Key||Accepted Values||Description|
||When a node is running a pod with such a label, The node will not violently scale down|
||If a pod is assigned with this label it relays on other running pods in the node. In case that there aren’t running pods in the node (except daemon sets) the pod will be terminated.|
||Pods which contain this label are forced to run on an on-demand instance|
apiVersion: v1 kind: Pod metadata: name: with-node-selector spec: containers: - name: with-node-selector image: k8s.gcr.io/pause:2.0 imagePullPolicy: IfNotPresent nodeSelector: spotinst.io/pods-contingency: true
apiVersion: v1 kind: Pod metadata: name: with-node-affinity spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: spotinst.io/node-lifecycle operator: In values: - od preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: spotinst.io/restrict-scale-down operator: In values: - true containers: - name: with-node-affinity image: k8s.gcr.io/pause:2.0