apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-grpc
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dataflow-grpc
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dataflow-grpc
    spec:
      containers:
        - name: dataflow-grpc
          image: cp9.local/dataflow-svc:placeholder
          imagePullPolicy: IfNotPresent
          command:
            - /dataflow
          args:
            - grpc
            - --config=/etc/dataflow/config.yaml
          ports:
            - name: grpc
              containerPort: 10000
            - name: metrics
              containerPort: 9090
          readinessProbe:
            tcpSocket:
              port: 10000
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 1
            failureThreshold: 10
          volumeMounts:
            - name: config
              mountPath: /etc/dataflow
              readOnly: true
      volumes:
        - name: config
          configMap:
            name: dataflow-svc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-http
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dataflow-http
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dataflow-http
    spec:
      containers:
        - name: dataflow-http
          image: cp9.local/dataflow-svc:placeholder
          imagePullPolicy: IfNotPresent
          command:
            - /dataflow
          args:
            - http
            - --config=/etc/dataflow/config.yaml
          ports:
            - name: http
              containerPort: 11000
            - name: inner-http
              containerPort: 12000
            - name: metrics
              containerPort: 9090
          readinessProbe:
            tcpSocket:
              port: 11000
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 1
            failureThreshold: 10
          volumeMounts:
            - name: config
              mountPath: /etc/dataflow
              readOnly: true
      volumes:
        - name: config
          configMap:
            name: dataflow-svc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-worker
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dataflow-worker
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dataflow-worker
    spec:
      containers:
        - name: dataflow-worker
          image: cp9.local/dataflow-svc:placeholder
          imagePullPolicy: IfNotPresent
          command:
            - /dataflow
          args:
            - worker
            - --config=/etc/dataflow/config.yaml
          ports:
            - name: metrics
              containerPort: 9090
          readinessProbe:
            tcpSocket:
              port: 9090
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 1
            failureThreshold: 10
          volumeMounts:
            - name: config
              mountPath: /etc/dataflow
              readOnly: true
      volumes:
        - name: config
          configMap:
            name: dataflow-svc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-workflow
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dataflow-workflow
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dataflow-workflow
    spec:
      containers:
        - name: dataflow-workflow
          image: cp9.local/dataflow-svc:placeholder
          imagePullPolicy: IfNotPresent
          env:
            - name: POD_NAME
              value: dataflow-workflow-1
          command:
            - /dataflow
          args:
            - workflow
            - --config=/etc/dataflow/config.yaml
          ports:
            - name: metrics
              containerPort: 9090
          readinessProbe:
            tcpSocket:
              port: 9090
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 1
            failureThreshold: 10
          volumeMounts:
            - name: config
              mountPath: /etc/dataflow
              readOnly: true
      volumes:
        - name: config
          configMap:
            name: dataflow-svc-config
