From 7f4b91c8ab8c84511ea778bff7c585d65f5082fc Mon Sep 17 00:00:00 2001 From: Alex Clemmer <clemmer.alexander@gmail.com> Date: Thu, 21 Sep 2017 14:29:25 -0700 Subject: [PATCH] Add example to the service prototype's documentation --- prototype/systemPrototypes.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/prototype/systemPrototypes.go b/prototype/systemPrototypes.go index 3526db6e..cbe40c85 100644 --- a/prototype/systemPrototypes.go +++ b/prototype/systemPrototypes.go @@ -46,14 +46,18 @@ namespace.`, Name: "io.ksonnet.pkg.single-port-service", Params: ParamSchemas{ RequiredParam("name", "serviceName", "Name of the service", String), - RequiredParam("targetLabelSelector", "selector", "Label for the service to target (e.g., 'app: MyApp').", Object), + RequiredParam("targetLabelSelector", "selector", `Label for the service to target (e.g., "{app: 'MyApp'}").`, Object), RequiredParam("servicePort", "port", "Port for the service to expose.", NumberOrString), RequiredParam("targetPort", "port", "Port for the service target.", NumberOrString), OptionalParam("protocol", "protocol", "Protocol to use (either TCP or UDP).", "TCP", String), }, Template: SnippetSchema{ Description: `A service that exposes 'servicePort', and directs traffic -to 'targetLabelSelector', at 'targetPort'.`, +to 'targetLabelSelector', at 'targetPort'. Since 'targetLabelSelector' is an +object literal that specifies which labels the service is meant to target, this +will typically look something like: + + ksonnet prototype use service --targetLabelSelector "{app: 'nginx'}" [...]`, ShortDescription: `Service that exposes a single port`, YAMLBody: []string{ "kind: Service", -- GitLab