apiVersion: v1
kind: Service
metadata:
  labels:
    app: << APP_NAME >>
  name: << APP_NAME >>
spec:
  ports:
  - port: << PORT >> 
    name: http
    protocol: TCP
    targetPort: << PORT >>
  selector:
    app: << APP_NAME >>
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: << APP_NAME >>
  name: << APP_NAME >>
spec:
  replicas: << POD_NUM >>
  selector:
    matchLabels:
      app: << APP_NAME >>
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: << APP_NAME >>
    spec:
      containers:
      - image: << IMAGE_NAME >>
        name: << APP_NAME >>
        imagePullPolicy: Always
        ports:
        - containerPort: << PORT >>
        workingDir: << WORKDIR >>
        name: << APP_NAME >>
        command: ['/bin/bash', '-c']
        args: [<< COMMAND >>] 
        env:
          - name: SERVING_BIN
            value: "/usr/local/serving_bin/serving"
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
        resources: {}
