Last active
April 25, 2019 15:57
-
-
Save deliahu/a795c9702cc9e1ce46eb773d61f3abb1 to your computer and use it in GitHub Desktop.
TensorFlow Serving on Kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: iris | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: iris-classifier | |
template: | |
metadata: | |
labels: | |
app: iris-classifier | |
spec: | |
initContainers: | |
- name: download-model | |
image: busybox | |
command: ["/bin/sh", "-c"] | |
args: ["wget -qO- https://s3-us-west-2.amazonaws.com/cortex-blog/tf-serving-k8s/iris.tar.gz | tar xvz -C /models/iris"] | |
volumeMounts: | |
- name: model | |
mountPath: /models/iris | |
containers: | |
- name: serving | |
image: tensorflow/serving | |
env: | |
- name: MODEL_NAME | |
value: iris | |
ports: | |
- containerPort: 8501 | |
readinessProbe: | |
tcpSocket: | |
port: 8500 | |
volumeMounts: | |
- name: model | |
mountPath: /models/iris | |
volumes: | |
- name: model | |
emptyDir: {} | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: iris | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 8501 | |
selector: | |
app: iris-classifier | |
type: LoadBalancer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment