serviceType: LoadBalancer
## expose the service to the grpc client
port: 9090
replicas: 1
image: "registry.cn-hangzhou.aliyuncs.com/tensorflow-samples/tensorflow-serving:1.4.0-devel-gpu"
imagePullPolicy: "IfNotPresent"
## the gpu resource to claim, for cpu, change it to 0
gpuCount: 1
## The command and args to run the pod
command: ["/usr/bin/tensorflow_model_server"]
args: [ "--port=9090", "--model_name=mnist", "--model_base_path=/serving/model/mnist"]
## the mount path inside the container
mountPath: /serving/model/mnist
persistence:
## The request and label to select the persistent volume
pvc:
storage: 5Gi
matchLabels:
model: mnist
创建支持非 GPU 的自定义配置参数:
serviceType: LoadBalancer
## expose the service to the grpc client
port: 9090
replicas: 1
command:
- /usr/bin/tensorflow_model_server
args:
- "--port=9090"
- "--model_name=mnist"
- "--model_base_path=/serving/model/mnist"
image: "registry.cn-hangzhou.aliyuncs.com/tensorflow-samples/tensorflow-serving:1.4.0-devel"
imagePullPolicy: "IfNotPresent"
mountPath: /serving/model/mnist
persistence:
mountPath: /serving/model/mnist
pvc:
matchLabels:
model: mnist
storage: 5Gi
# helm list
NAME REVISION UPDATED STATUS CHART NAMESPACE
mnist-deploy 1 Fri Mar 16 19:24:35 2018 DEPLOYED acs-tensorflow-serving-0.1.0 default
利用 helm status 命令检查具体应用的配置。
# helm status mnist-deploy
LAST DEPLOYED: Fri Mar 16 19:24:35 2018
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mnist-deploy-acs-tensorflow-serving LoadBalancer 172.19.XX.XX 139.195.XX.XX 9090:32560/TCP 5h
==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
mnist-deploy-serving 1 1 1 1 5h
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
mnist-deploy-serving-665fc69d84-pk9bk 1/1 Running 0 5h