提交 27b982f6 编写于 作者: S suoych

support k8s

上级 f3eb9d4a
......@@ -47,3 +47,13 @@ client send inference request
python resnet50_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt
```
*the port of server side in this example is 9696
### Launch Paddle Serving on Kubernetes
Paddle Serving support deployment on Kubernetes (K8S) clusters. From `imagenet_k8s_rpc.yaml` we define Serving as K8S Deployment and Service. User can deploy Serving on containers and expose internal or external service.
We strongly recommend [Baidu Cloud CCE Cluster](https://cloud.baidu.com/search.html?q=CCE)
```
kubectl apply -f imagenet_k8s_rpc.yaml
```
......@@ -47,3 +47,14 @@ client端进行预测
python resnet50_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt
```
*server端示例中服务端口为9696端口
### K8S启动
还可以运用K8S启动,在`imagenet_k8s_rpc.yaml`中定义了Serving的Deployment和Service,用户可以在K8S集群上启动Deployment并且通过Service对外暴露服务,用户可以在此基础上进行二次开发。
推荐百度云的[CCE(K8S)集群](https://cloud.baidu.com/search.html?q=CCE)
```
kubectl apply -f imagenet_k8s_rpc.yaml
```
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: paddleserving
labels:
app: paddleserving
spec:
replicas: 1
template:
metadata:
name: paddleserving
labels:
app: paddleserving
spec:
containers:
- name: paddleserving
image: hub.baidubce.com/paddlepaddle/serving:latest
imagePullPolicy: Always
workingDir: /
command: ['/bin/bash', '-c']
args: ['pip install -U paddle-serving-server paddle-serving-client paddle-serving-app && \
python -m paddle_serving_app.package --get_model resnet_v2_50_imagenet && \
tar xf resnet_v2_50_imagenet.tar.gz && \
python -m paddle_serving_server.serve --model resnet_v2_50_imagenet_model/ --port 9696']
ports:
- containerPort: 9696
name: serving
---
apiVersion: v1
kind: Service
metadata:
name: paddleserving
spec:
ports:
- name: paddleserving
port: 9696
targetPort: 9696
selector:
app: paddleserving
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册