Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option service_type to set TFServing service type #302

Merged
merged 2 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// @param model_path string Path to the model. This can be a GCS path.
// @optionalParam model_server_image string gcr.io/kubeflow/model-server:1.0 Container for TF model server
// @optionalParam http_proxy_image string gcr.io/kubeflow/http-proxy:1.0 Container for http_proxy of TF model server
// @optionalParam service_type string ClusterIP The service type for TFServing deployment.

// TODO(https://github.com/ksonnet/ksonnet/issues/222): We have to add namespace as an explicit parameter
// because ksonnet doesn't support inheriting it from the environment yet.
Expand All @@ -19,8 +20,9 @@ local namespace = import "param://namespace";
local modelPath = import "param://model_path";
local modelServerImage = import "param://model_server_image";
local httpProxyImage = import "param://http_proxy_image";
local serviceType = import "param://service_type";

std.prune(k.core.v1.list.new([
tfServing.parts.deployment.modelServer(name, namespace, modelPath, modelServerImage, httpProxyImage),
tfServing.parts.deployment.modelService(name, namespace),
tfServing.parts.deployment.modelService(name, namespace, serviceType),
]))
4 changes: 2 additions & 2 deletions kubeflow/tf-serving/tf-serving.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local networkSpec = networkPolicy.mixin.spec;
},
},

modelService(name, namespace, labels={ app: name }): {
modelService(name, namespace, serviceType, labels={ app: name }): {
apiVersion: "v1",
kind: "Service",
metadata: {
Expand All @@ -45,7 +45,7 @@ local networkSpec = networkPolicy.mixin.spec;
},
],
selector: labels,
type: "ClusterIP",
type: serviceType,
},
},

Expand Down