Update imperative-command.md (#7699)
- Original example (with <myservicename> replaced with my-svc) will result in the following error: error: at least one tcp port specifier must be provided - Use the same example in this section seems ideal
This commit is contained in:
@@ -127,7 +127,7 @@ creation. This is done by piping the output of the `create` command to the
|
||||
`set` command, and then back to the `create` command. Here's an example:
|
||||
|
||||
```sh
|
||||
kubectl create service clusterip <myservicename> -o yaml --dry-run | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -
|
||||
kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -
|
||||
```
|
||||
|
||||
1. The `kubectl create service -o yaml --dry-run` command creates the configuration for the Service, but prints it to stdout as YAML instead of sending it to the Kubernetes API server.
|
||||
|
||||
Reference in New Issue
Block a user