apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-deployment
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      component: redis
  template:
    metadata:
      labels:
        component: redis
        type: db
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - preference:
              matchExpressions:
              - key: cloud.google.com/gke-preemptible
                operator: DoesNotExist
            weight: 100
      containers:
      - name: redis
        image: redis:6
        resources:
          limits:
            memory: "512Mi"
            cpu: "100m"
        ports:
        - containerPort: 6379
