Skip to content

Commit d3461a9

Browse files
committed
olmv1 readme
Signed-off-by: Ankita Thomas <[email protected]>
1 parent 75ba494 commit d3461a9

File tree

1 file changed

+298
-0
lines changed

1 file changed

+298
-0
lines changed

olmv1.md

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
# Kubectl Operator OLMv1 Commands
2+
3+
Most of the kubectl operator plugin subcommands are aimed toward managing OLMv0 operators.
4+
5+
[OLMv1](https://github.com/operator-framework/operator-controller/) has two main on-cluster CRDs, both of which can be managed by the kubectl operator `olmv1` subcommand. These are the [`ClusterCatalogs`](https://github.com/operator-framework/operator-controller/blob/main/api/v1/clustercatalog_types.go) and [`ClusterExtensions`](https://github.com/operator-framework/operator-controller/blob/main/api/v1/clusterextension_types.go). Within the repository, these are defined in `internal/cmd/olmv1.go`, which in turn references `internal/cmd/internal/olmv1` and `internal/pkg/v1`.
6+
7+
```bash
8+
$ kubectl operator olmv1 --help
9+
10+
Manage extensions via `olmv1` in a cluster from the command line.
11+
12+
Usage:
13+
operator olmv1 [command]
14+
15+
Available Commands:
16+
create Create a resource
17+
delete Delete a resource
18+
get Display one or many resource(s)
19+
install Install a resource
20+
update Update a resource
21+
```
22+
23+
Of the global flags, only `--help` is relevant to `olmv1` and its subcommands. The `olmv1` subcommands are detailed as follows.
24+
25+
<br/>
26+
<br/>
27+
28+
---
29+
30+
## `olmv1 create`
31+
Create `olmv1` resources, currently supports only `ClusterCatalogs`.
32+
33+
```bash
34+
Create a resource
35+
36+
Usage:
37+
operator olmv1 create [command]
38+
39+
Available Commands:
40+
catalog Create a new catalog
41+
```
42+
<br/>
43+
44+
### `olmv1 create catalog`
45+
Create a new `ClusterCatalog` with the provided name and catalog image reference.
46+
47+
```bash
48+
Create a new catalog
49+
50+
Usage:
51+
operator olmv1 create catalog <catalog_name> <image_source_ref> [flags]
52+
53+
Aliases:
54+
catalog, catalogs <catalog_name> <image_source_ref>
55+
56+
Flags:
57+
--available true means that the catalog should be active and serving data (default true)
58+
--cleanup-timeout duration the amount of time to wait before cancelling cleanup after a failed creation attempt (default 1m0s)
59+
--labels stringToString labels that will be added to the catalog (default [])
60+
--priority int32 priority determines the likelihood of a catalog being selected in conflict scenarios
61+
--source-poll-interval-minutes int catalog source polling interval [in minutes] (default 10)
62+
```
63+
64+
The flags allow for setting most mutable fields:
65+
- `--available`: Sets whether the `ClusterCatalog` should be actively serving and make its contents available on cluster. Default: true.
66+
- `--cleanup-timeout`: If a `ClusterCatalog` creation attempt fails due to the resource never becoming healthy, `olmv1` cleans up by deleting the failed resource, with a timeout specified by `--cleanup-timeout`. Default: 1 minute (1m)
67+
- `--labels`: Additional labels to add to the newly created `ClusterCatalog` as `key=value` pairs. This flag may be specified multiple times.
68+
- `--priority`: Integer priority used for ordering `ClusterCatalogs` in case two extension packages have the same name across catalogs, with a higher value indicating greater relative priority. Default: 0
69+
- `--source-poll-interval-minutes`: The polling interval to check for changes if the `ClusterCatalog` source image provided is not a digest based image, i.e, if it is referenced by tag. Set to 0 to disable polling. Default: 10
70+
<br/>
71+
<br/>
72+
---
73+
## olmv1 install
74+
Install resources with olmv1, currently supports `ClusterExtensions`.
75+
76+
```bash
77+
Install a resource
78+
79+
Usage:
80+
operator olmv1 install [command]
81+
82+
Available Commands:
83+
extension Install an extension
84+
```
85+
<br/>
86+
87+
### olmv1 install extension
88+
89+
Install a new `ClusterExtension` with the provided namez.
90+
91+
```bash
92+
Install an extension
93+
94+
Usage:
95+
operator olmv1 install extension <extension_name> [flags]
96+
97+
Flags:
98+
-c, --channels strings channels which would be used for getting updates, e.g, --channels "stable,dev-preview,preview"
99+
-d, --cleanup-timeout duration the amount of time to wait before cancelling cleanup after a failed creation attempt (default 1m0s)
100+
-n, --namespace string namespace to install the operator in
101+
-p, --package-name string package name of the operator to install
102+
-s, --service-account string service account name to use for the extension installation (default "default")
103+
-v, --version string version (or version range) from which to resolve bundles
104+
```
105+
106+
The flags allow for setting most mutable fields:
107+
- `-c`, `--channels`: An optional list of channels within a package to restrict searches for an installable version to.
108+
- `-d`, `--cleanup-timeout`: If a `ClusterExtension` creation attempt fails due to the resource never becoming healthy, `olmv1` cleans up by deleting the failed resource, with a timeout specified by `--cleanup-timeout`. Default: 1 minute (1m)
109+
- `-n`, `--namespace`: The namespace to install any namespace-scoped resources created by the `ClusterExtension`. *Required*
110+
- `-p`, `--package-name`: Name of the package to install. *Required*
111+
- `-s`, `--service-account`: Name of the service account present in the namespace specified by `--namespace` to use for creating and managing resources for the new `ClusterExtension`.
112+
- `-v`, `--version`: A version or version range to restrict search for an installable version to.
113+
<br/>
114+
<br/>
115+
---
116+
117+
## olmv1 delete
118+
119+
Delete `olmv1` resources.
120+
121+
```bash
122+
Delete a resource
123+
124+
Usage:
125+
operator olmv1 delete [command]
126+
127+
Available Commands:
128+
catalog Delete either a single or all of the existing catalogs
129+
extension Delete an extension
130+
```
131+
<br/>
132+
133+
### olmv1 delete catalog
134+
135+
Delete a `ClusterCatalog` by name. Specifying `--all` flag allows for cleaning up all existing `ClusterCatalogs`, and cannot be used when a resource name is passed as an argument.
136+
137+
138+
```bash
139+
Delete either a single or all of the existing catalogs
140+
141+
Usage:
142+
operator olmv1 delete catalog [catalog_name] [flags]
143+
144+
Aliases:
145+
catalog, catalogs [catalog_name]
146+
147+
Flags:
148+
--all delete all catalogs
149+
```
150+
<br/>
151+
152+
### olmv1 delete extension
153+
154+
Delete a `ClusterExtension` by name. Specifying `--all` flag allows for cleaning up all existing `ClusterExtensions`, and cannot be used when a resource name is passed as an argument.
155+
156+
```bash
157+
Usage:
158+
operator olmv1 delete extension [extension_name] [flags]
159+
160+
Aliases:
161+
extension, extensions [extension_name]
162+
163+
Flags:
164+
-a, --all delete all extensions
165+
```
166+
<br/>
167+
<br/>
168+
169+
---
170+
171+
## olmv1 update
172+
173+
Update mutable fields on `olmv1` resources.
174+
175+
```bash
176+
Update a resource
177+
178+
Usage:
179+
operator olmv1 update [command]
180+
181+
Available Commands:
182+
catalog Update a catalog
183+
extension Update an extension
184+
```
185+
<br/>
186+
187+
### olmv1 update catalog
188+
189+
Update supported mutable fields on a `ClusterCatalog` specified by name.
190+
191+
```bash
192+
Update a catalog
193+
194+
Usage:
195+
operator olmv1 update catalog <catalog_name> [flags]
196+
197+
Flags:
198+
--availability-mode string available means that the catalog should be active and serving data
199+
--ignore-unset when enabled, any unset flag value will not be changed. Disabling this flag replaces all other unset or empty values with a default value, overwriting any values on the existing CR (default true)
200+
--image string Image reference for the catalog source. Leave unset to retain the current image.
201+
--labels stringToString labels that will be added to the catalog (default [])
202+
--priority int32 priority determines the likelihood of a catalog being selected in conflict scenarios
203+
--source-poll-interval-minutes int catalog source polling interval [in minutes]. Set to 0 or -1 to remove the polling interval. (default 5)
204+
```
205+
206+
The flags allow for setting most mutable fields:
207+
- `--ignore-unset`: Sets the behavior of unspecified or empty flags, whether they should be ignored, preserving the current value on the resource, or treated as valid and used to set the field values to their default value.
208+
- `--availablity-mode`: Sets whether the `ClusterCatalog` should be actively serving and make its contents available on cluster. Valid values: `Available`|`Unavailable`.
209+
- `--image`: Update the image reference for the `ClusterCatalog`.
210+
- `--labels`: Additional labels to add to the `ClusterCatalog` as `key=value` pairs. This flag may be specified multiple times. Setting the value of a label to an empty string deletes the label from the resource.
211+
- `--priority`: Integer priority used for ordering `ClusterCatalogs` in case two extension packages have the same name across catalogs, with a higher value indicating greater relative priority.
212+
- `--source-poll-interval-minutes`: The polling interval to check for changes if the `ClusterCatalog` source image provided is not a digest based image, i.e, if it is referenced by tag. Set to 0 or -1 to disable polling.
213+
<br/>
214+
215+
### olmv1 update extension
216+
217+
Update supported mutable fields on a `ClusterExtension` specified by name.
218+
219+
```bash
220+
Update an extension
221+
222+
Usage:
223+
operator olmv1 update extension <extension> [flags]
224+
225+
Flags:
226+
--channels stringArray desired channels for extension versions. AND operation with version. If empty or not specified, all available channels will be taken into consideration
227+
--ignore-unset when enabled, any unset flag value will not be changed. Disabling this flag replaces all other unset or empty values with a default value, overwriting any values on the existing CR (default true)
228+
--labels stringToString labels that will be set on the extension (default [])
229+
--selector string filters the set of catalogs used in the bundle selection process. Empty means that all catalogs will be used in the bundle selection process
230+
--upgrade-constraint-policy string controls whether the upgrade path(s) defined in the catalog are enforced. One of CatalogProvided|SelfCertified, Default: CatalogProvided
231+
--version string desired extension version (single or range) in semVer format. AND operation with channels
232+
```
233+
234+
The flags allow for setting most mutable fields:
235+
- `--ignore-unset`: Sets the behavior of unspecified or empty flags, whether they should be ignored, preserving the current value on the resource, or treated as valid and used to set the field values to their default value.
236+
- `-v`, `--version`: A version or version range to restrict search for a version upgrade.
237+
- `-c`, `--channels`: An optional list of channels within a package to restrict searches for updates. If empty or unspecified, no channel restrictions apply while searching for valid package versions for extension updates.
238+
- `--upgrade-constraint-policy`: Specifies upgrade selection behavior. Valid values: `CatalogProvided|SelfCertified`. `SelfCertified` can be used to override upgrade graphs within a catalog and upgrade to any version at the risk of using non-standard upgrade paths. `CatalogProvided` restricts upgrades to standard paths between versions explicitly allowed within the `ClusterCatalog`.
239+
- `--labels`: Additional labels to add to the `ClusterExtension` as `key=value` pairs. This flag may be specified multiple times. Setting the value of a label to an empty string deletes the label from the resource.
240+
241+
<br/>
242+
<br/>
243+
244+
---
245+
246+
## olmv1 get
247+
Display status information of `olmv1` resources.
248+
249+
```bash
250+
Display one or many resource(s)
251+
252+
Usage:
253+
operator olmv1 get [command]
254+
255+
Available Commands:
256+
catalog Display one or many installed catalogs
257+
extension Display one or many installed extensions
258+
```
259+
<br/>
260+
261+
### olmv1 get catalog
262+
Display status information of all `ClusterCatalogs`.
263+
264+
```bash
265+
Display one or many installed catalogs
266+
267+
Usage:
268+
operator olmv1 get catalog [catalog_name] [flags]
269+
270+
Aliases:
271+
catalog, catalogs
272+
```
273+
274+
```bash
275+
$ kubectl operator olmv1 get catalog
276+
NAME AVAILABILITY PRIORITY LASTUNPACKED SERVING AGE
277+
operatorhubio Available 0 44m True 44m
278+
```
279+
<br/>
280+
281+
### olmv1 get extension
282+
Display status information of installed `ClusterExtensions`.
283+
284+
```bash
285+
Display one or many installed extensions
286+
287+
Usage:
288+
operator olmv1 get extension [extension_name] [flags]
289+
290+
Aliases:
291+
extension, extensions [extension_name]
292+
```
293+
294+
```bash
295+
$ kubectl operator olmv1 get extension
296+
NAME INSTALLED BUNDLE VERSION SOURCE TYPE INSTALLED PROGRESSING AGE
297+
test-operator prometheusoperator.0.47.0 0.47.0 Community Operators Index True False 44m
298+
```

0 commit comments

Comments
 (0)