apiVersion: apps/v1
kind: Deployment
metadata:
  name: kurl
spec:
  selector:
    matchLabels:
      app: kurl
  template:
    metadata:
      labels:
        app: kurl
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 2
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app
                  operator: In
                  values:
                  - kurl
              topologyKey: "kubernetes.io/hostname"
      volumes:
      - name: images
        emptyDir: {}
      containers:
      - name: server
        image: replicated/kurl
        imagePullPolicy: IfNotPresent
        command: ["/bin/server"]
        ports:
        - name: server
          containerPort: 3001
        resources:
          requests:
            cpu: 100m
          limits:
            cpu: 2
        volumeMounts:
        - name: images
          mountPath: "/images"
      - name: kurl
        image: replicated/kurl
        imagePullPolicy: IfNotPresent
        ports:
        - name: kurl
          containerPort: 3000
        env:
        - name: REPLICATED_APP_URL
          value: https://replicated.app
