apiVersion: apps/v1
kind: Deployment
metadata:
  name: peer-to-profit
  labels:
    app: peer-to-profit
spec:
  replicas: 2
  selector:
    matchLabels:
      app: peer-to-profit
  template:
    metadata:
      labels:
        app: peer-to-profit
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/hostname
                    operator: In
                    values:
                      - node-tokyo-1
                      - node-tokyo-2
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app
                      operator: In
                      values:
                        - peer-to-profit
                topologyKey: kubernetes.io/hostname
              weight: 100
      containers:
        - name: peer-to-profit
          image: peer-to-profit/peer-to-profit_linux:latest
          env:
            - name: P2P_EMAIL
              value: zeaslity@gmail.com


