-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8s-serving.yaml
72 lines (72 loc) · 1.83 KB
/
k8s-serving.yaml
1
2
3
4
5
6
7
8
9
10
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## TFServing deployment on kubernetes
# https://www.tensorflow.org/serving/serving_inception#create_kubernetes_deployment_and_service
---
apiVersion: v1
kind: Service
metadata:
name: tfserving
labels:
app: tfserving
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
ports:
- port: 8500
name: tfserving-http
- port: 8501
name: tfserving-grpc
clusterIP: None
selector:
app: tfserving
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tfserving-deployment
labels:
app: tfserving
spec:
replicas: 1
selector:
matchLabels:
app: tfserving
template:
metadata:
labels:
app: tfserving
spec:
containers:
- name: tfserving
image: tensorflow/serving
command: [ "/bin/bash", "-c" ]
args:
- "/usr/bin/tensorflow_model_server --server=0.0.0.0 --port=9000 --model_base_path=$MODEL_BASE_PATH --model_name=$MODEL_NAME"
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/tmp/gcp/gcp.json"
- name: MODEL_BASE_PATH
value: "gs://taxi_chicago/output/train/local_chicago_taxi_output/serving_model_dir/export/chicago-taxi"
- name: MODEL_NAME
value: "chicago_taxi"
volumeMounts:
- name: gcloud-creds
mountPath: /tmp/gcp
readOnly: true
- name: certs
mountPath: "/etc/ssl/certs"
initContainers:
- name: metadata-cert
image: tensorflow/serving
command: ["bash", "-c"]
args:
- "apt-get update && apt-get install -y curl && curl metadata"
volumeMounts:
- name: certs
mountPath: "/etc/ssl/certs"
dnsPolicy: Default
volumes:
- name: certs
emptyDir: {}
- name: gcloud-creds
secret:
secretName: gcloud-creds