apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-main
  labels:
    app: tpcc-main
spec:
  replicas: 2
  selector:
    matchLabels:
      app: tpcc-main
  template:
    metadata:
      labels:
        app: tpcc-main
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-main
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-main:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39080
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-main"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-neworder
  labels:
    app: tpcc-neworder
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-neworder
  template:
    metadata:
      labels:
        app: tpcc-neworder
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-neworder
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-neworder:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39081
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-neworder"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-orderstatus
  labels:
    app: tpcc-orderstatus
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-orderstatus
  template:
    metadata:
      labels:
        app: tpcc-orderstatus
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-orderstatus
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-orderstatus:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39084
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-orderstatus"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-user
  labels:
    app: tpcc-user
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-user
  template:
    metadata:
      labels:
        app: tpcc-user
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-user
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-user:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39087
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-user"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-delivery
  labels:
    app: tpcc-delivery
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-delivery
  template:
    metadata:
      labels:
        app: tpcc-delivery
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-delivery
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-delivery:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39088
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-delivery"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-payment
  labels:
    app: tpcc-payment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-payment
  template:
    metadata:
      labels:
        app: tpcc-payment
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-payment
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-payment:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39089
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-payment"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-sendmail
  labels:
    app: tpcc-sendmail
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-sendmail
  template:
    metadata:
      labels:
        app: tpcc-sendmail
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-sendmail
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-sendmail:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39090
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-sendmail"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-shipping
  labels:
    app: tpcc-shipping
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-shipping
  template:
    metadata:
      labels:
        app: tpcc-shipping
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-shipping
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-shipping:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39091
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-shipping"
        envFrom:
          - configMapRef:
              name: tpcc-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ .Values.global.TPCC_NAMESPACE }}
  name: tpcc-stocklevel
  labels:
    app: tpcc-stocklevel
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tpcc-stocklevel
  template:
    metadata:
      labels:
        app: tpcc-stocklevel
        traceAgentType: jspd
    spec:
      containers:
      - name: tpcc-stocklevel
        image: {{ .Values.global.IMXC_IN_REGISTRY }}/tpcc-stocklevel:JSPD
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 39092
        env:
          - name: CMOA_JSPDCOLLECT_IP
            value: jspd-lite-collector.{{ .Values.global.AGENT_NAMESPACE }}
          - name: CMOA_JSPDCOLLECT_PORT
            value: "50083"
          - name: CMOA_CLST_ID
            value: {{ .Values.global.CLUSTER_ID }}
          - name: CMOA_NODE_ID
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CMOA_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CMOA_POD_ID
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: CMOA_SERVICE
            value: "tpcc-stocklevel"

        envFrom:
          - configMapRef:
              name: tpcc-config

