apiVersion: apps/v1
kind: Deployment
metadata:
  name: step1-cloud1
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: step1
  template:
    metadata:
      labels:
        app: step1
        stepName: step1
        zone: cloud1
    spec:
      containers:
        - name: sidecar
          image: alincorodescu/msc-workflows-sidecar:latest
          env:
            - name: ASPNETCORE_URLS
              value: http://+:5000
            - name: NODE_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.hostIP
          ports:
            - containerPort: 5000
              protocol: TCP
        - name: compute
          image: alincorodescu/msc-workflows-compute:latest
          env:
            - name: ASPNETCORE_URLS
              value: http://localhost:5002
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: NODE_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.hostIP
          volumeMounts:
            - mountPath: /in
              name: inputs
            - mountPath: /out
              name: outputs
      nodeSelector:
        zone: cloud1
      volumes:
        - name: inputs
          hostPath:
            path: /store/inputs
        - name: outputs
          hostPath:
            path: /store/outputs
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: stepName
                operator: In
                values:
                - step1
            topologyKey: "kubernetes.io/hostname"