apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  namespace: production
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx:mainline-alpine
        name: nginx
        ports:
        - containerPort: 80
        volumeMounts:
        - name: nginx-conf
          mountPath: /etc/nginx/conf.d
        resources:
          requests:
            memory: 10Mi
      restartPolicy: Always
      volumes:
      - name: nginx-conf
        configMap:
          name: nginx-conf
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: cloud.google.com/gke-preemptible
                operator: DoesNotExist
