apiVersion: apps/v1 #  for k8s versions before 1.9.0 use apps/v1beta2  and before 1.8.0 use extensions/v1beta1
kind: Deployment
metadata:
  name: parity-system
spec:
  selector:
    matchLabels:
      app: parity-system
  replicas: 1
  template:
    metadata:
      labels:
        app: parity-system
    spec:
      containers:
      - name: parity-system 
        image: docker.io/rrmaje/parity-system
        imagePullPolicy: Always
        env:
            - name: PARITY_SYSTEM_ADDRESS
              valueFrom:
                fieldRef:
                   fieldPath: status.podIP 
            - name: PARITY_SYSTEM_INSTRUMENTS
              value: "S-class,M-class,L-class"
        ports:
         - containerPort: 4000
         - containerPort: 5000
         - containerPort: 5001
         - containerPort: 6000
         - containerPort: 6001
      - name: nassau-soupbintcp-gateway-market-reporting
        image: docker.io/rrmaje/nassau-soupbintcp-gateway
        imagePullPolicy: Always
        env:
            - name: NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_ADDRESS
              valueFrom:
                fieldRef:
                   fieldPath: status.podIP
            - name: NASSAU_SOUPBINTCP_GATEWAY_DOWNSTREAM_PORT
              value: "6002"
            - name: NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_PORT
              value: "6000"
            - name: NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_PORT
              value: "6001"
        ports:
            - containerPort: 6002
      - name: nassau-soupbintcp-gateway-market-data
        image: docker.io/rrmaje/nassau-soupbintcp-gateway
        imagePullPolicy: Always
        env:
            - name: NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_ADDRESS
              valueFrom:
                fieldRef:
                   fieldPath: status.podIP
            - name: NASSAU_SOUPBINTCP_GATEWAY_DOWNSTREAM_PORT
              value: "5002"
        ports:
            - containerPort: 5002

