k8s_serving.yaml_template 1.4 KB
Newer Older
W
wangjiawei04 已提交
1 2 3 4 5 6 7 8 9
apiVersion: v1
kind: Service
metadata:
  labels:
    app: << APP_NAME >>
  name: << APP_NAME >>
spec:
  ports:
  - port: << PORT >> 
J
Jiawei Wang 已提交
10
    name: http
W
wangjiawei04 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    protocol: TCP
    targetPort: << PORT >>
  selector:
    app: << APP_NAME >>
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: << APP_NAME >>
  name: << APP_NAME >>
spec:
  replicas: 1
  selector:
    matchLabels:
      app: << APP_NAME >>
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: << APP_NAME >>
    spec:
      containers:
      - image: << IMAGE_NAME >>
        name: << APP_NAME >>
B
bjjwwang 已提交
37
        imagePullPolicy: Always
W
wangjiawei04 已提交
38 39 40 41 42 43 44
        ports:
        - containerPort: << PORT >>
        workingDir: << WORKDIR >>
        name: << APP_NAME >>
        command: ['/bin/bash', '-c']
        args: [<< COMMAND >>] 
        env:
B
bjjwwang 已提交
45 46
          - name: SERVING_BIN
            value: "/usr/local/serving_bin/serving"
W
wangjiawei04 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
          - 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: {}