---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-no-split
  labels:
    app: nginx-no-split
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx-no-split
  template:
    metadata:
      labels:
        app: nginx-no-split
    spec:
      tolerations:
        - key: "spotInstance"
          operator: "Equal"
          value: "true"
          effect: "PreferNoSchedule"
      nodeSelector:
        lifecycle: OnDemand
      schedulerName: Ec2SpotK8sScheduler  
      containers:
        - name: nginx-no-split
          image: nginx:1.14.2
          resources:
            requests:
              memory: "512Mi"
              cpu: "1024m"
            limits:
              memory: "512Mi"
              cpu: "1024m"
          ports:
            - containerPort: 80