... | ... |
@@ -385,6 +385,9 @@ Expose a replicated application as a service or route |
385 | 385 |
|
386 | 386 |
# Expose a deployment configuration as a service and use the specified port |
387 | 387 |
$ oc expose dc ruby-hello-world --port=8080 |
388 |
+ |
|
389 |
+ # Expose a service as a route in the specified path |
|
390 |
+ $ oc expose service nginx --path=/nginx |
|
388 | 391 |
---- |
389 | 392 |
==== |
390 | 393 |
|
... | ... |
@@ -32,7 +32,10 @@ labels from the object it exposes.` |
32 | 32 |
$ %[1]s expose service nginx --hostname=www.example.com |
33 | 33 |
|
34 | 34 |
# Expose a deployment configuration as a service and use the specified port |
35 |
- $ %[1]s expose dc ruby-hello-world --port=8080` |
|
35 |
+ $ %[1]s expose dc ruby-hello-world --port=8080 |
|
36 |
+ |
|
37 |
+ # Expose a service as a route in the specified path |
|
38 |
+ $ %[1]s expose service nginx --path=/nginx` |
|
36 | 39 |
) |
37 | 40 |
|
38 | 41 |
// NewCmdExpose is a wrapper for the Kubernetes cli expose command |
... | ... |
@@ -57,6 +60,7 @@ func NewCmdExpose(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.C |
57 | 57 |
defRun(cmd, args) |
58 | 58 |
} |
59 | 59 |
cmd.Flags().String("hostname", "", "Set a hostname for the new route") |
60 |
+ cmd.Flags().String("path", "", "Set a path for the new route") |
|
60 | 61 |
return cmd |
61 | 62 |
} |
62 | 63 |
|
... | ... |
@@ -163,6 +167,9 @@ func validateFlags(cmd *cobra.Command, generator string) error { |
163 | 163 |
if len(cmdutil.GetFlagString(cmd, "hostname")) != 0 { |
164 | 164 |
invalidFlags = append(invalidFlags, "--hostname") |
165 | 165 |
} |
166 |
+ if len(cmdutil.GetFlagString(cmd, "path")) != 0 { |
|
167 |
+ invalidFlags = append(invalidFlags, "--path") |
|
168 |
+ } |
|
166 | 169 |
case "route/v1": |
167 | 170 |
if len(cmdutil.GetFlagString(cmd, "protocol")) != 0 { |
168 | 171 |
invalidFlags = append(invalidFlags, "--protocol") |