Skip to content

Commit 8cd582c

Browse files
authored
Merge pull request #290 from shawn-hurley/add-docs-266
doc/sdk-cli-reference: Adding details for up/local command.
2 parents 89bf021 + b11c0a5 commit 8cd582c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

doc/sdk-cli-reference.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ generates a default directory layout based on the input `project-name`.
136136

137137
### Args
138138

139-
* `project-name` - the project name of the new
139+
* `project-name` - the project name of the new
140140

141141
### Flags
142142

@@ -186,6 +186,22 @@ operator-sdk up local --kubeconfig "mycluster.kubecfg" \
186186
--operator-flags "--flag1 value1 --flag2=value2"
187187
```
188188

189+
The below example will use the default kubeconfig, the default namespace environment var, and pass in flags for the operator.
190+
To use the operator flags, your operator must know how to handle the option. Below imagine an operator that understands the `resync-interval` flag.
191+
192+
```bash
193+
operator-sdk up local --operator-flags "--resync-interval 10"
194+
```
195+
196+
If you are planning on using a different namespace than the default, then you should use the `--namespace` flag to change where the operator is watching for custom resources to be created.
197+
For this to work your operator must handle the `WATCH_NAMESPACE` environment variable. To do that you can use the [utility function][utility_link] `k8sutil.GetWatchNamespace` in your operator.
198+
199+
```bash
200+
operator-sdk up local --namespace "testing"
201+
```
202+
189203
### Flags
190204

191205
* `-h, --help` - help for up
206+
207+
[utility_link]: https://github.com/operator-framework/operator-sdk/blob/89bf021063d18b6769bdc551ed08fc37027939d5/pkg/util/k8sutil/k8sutil.go#L140

0 commit comments

Comments
 (0)