Skip to content

Commit fa7440d

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

File tree

1 file changed

+297
-0
lines changed

1 file changed

+297
-0
lines changed

olmv1.md

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
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 either a single `ClusterCatalog` by name, or all `ClusterCatalogs` on cluster. The `--all` flag allows for cleaning up all existing catalogs on cluster, and cannot be used when a `ClusterCatalog` name is passed as an argument.
136+
137+
```bash
138+
Delete either a single or all of the existing catalogs
139+
140+
Usage:
141+
operator olmv1 delete catalog [catalog_name] [flags]
142+
143+
Aliases:
144+
catalog, catalogs [catalog_name]
145+
146+
Flags:
147+
--all delete all catalogs
148+
```
149+
<br/>
150+
151+
### olmv1 delete extension
152+
153+
Delete a `ClusterExtension` by name. Specifying `--all` flag allows for cleaning up all existing catalogs on cluster, and cannot be used when a `ClusterCatalog` name is passed as an argument.
154+
155+
```bash
156+
Usage:
157+
operator olmv1 delete extension [extension_name] [flags]
158+
159+
Aliases:
160+
extension, extensions [extension_name]
161+
162+
Flags:
163+
-a, --all delete all extensions
164+
```
165+
<br/>
166+
<br/>
167+
168+
---
169+
170+
## olmv1 update
171+
172+
Update mutable fields on `olmv1` resources.
173+
174+
```bash
175+
Update a resource
176+
177+
Usage:
178+
operator olmv1 update [command]
179+
180+
Available Commands:
181+
catalog Update a catalog
182+
extension Update an extension
183+
```
184+
<br/>
185+
186+
### olmv1 update catalog
187+
188+
Update supported mutable fields on a `ClusterCatalog` specified by name.
189+
190+
```bash
191+
Update a catalog
192+
193+
Usage:
194+
operator olmv1 update catalog <catalog_name> [flags]
195+
196+
Flags:
197+
--availability-mode string available means that the catalog should be active and serving data
198+
--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)
199+
--image string Image reference for the catalog source. Leave unset to retain the current image.
200+
--labels stringToString labels that will be added to the catalog (default [])
201+
--priority int32 priority determines the likelihood of a catalog being selected in conflict scenarios
202+
--source-poll-interval-minutes int catalog source polling interval [in minutes]. Set to 0 or -1 to remove the polling interval. (default 5)
203+
```
204+
205+
The flags allow for setting most mutable fields:
206+
- `--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.
207+
- `--availablity-mode`: Sets whether the `ClusterCatalog` should be actively serving and make its contents available on cluster. Valid values: `Available`|`Unavailable`.
208+
- `--image`: Update the image reference for the `ClusterCatalog`.
209+
- `--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.
210+
- `--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.
211+
- `--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.
212+
<br/>
213+
214+
### olmv1 update extension
215+
216+
Update supported mutable fields on a `ClusterExtension` specified by name.
217+
218+
```bash
219+
Update an extension
220+
221+
Usage:
222+
operator olmv1 update extension <extension> [flags]
223+
224+
Flags:
225+
--channels stringArray desired channels for extension versions. AND operation with version. If empty or not specified, all available channels will be taken into consideration
226+
--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)
227+
--labels stringToString labels that will be set on the extension (default [])
228+
--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
229+
--upgrade-constraint-policy string controls whether the upgrade path(s) defined in the catalog are enforced. One of CatalogProvided|SelfCertified, Default: CatalogProvided
230+
--version string desired extension version (single or range) in semVer format. AND operation with channels
231+
```
232+
233+
The flags allow for setting most mutable fields:
234+
- `--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.
235+
- `-v`, `--version`: A version or version range to restrict search for a version upgrade.
236+
- `-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.
237+
- `--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`.
238+
- `--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.
239+
240+
<br/>
241+
<br/>
242+
243+
---
244+
245+
## olmv1 get
246+
Display status information of `olmv1` resources.
247+
248+
```bash
249+
Display one or many resource(s)
250+
251+
Usage:
252+
operator olmv1 get [command]
253+
254+
Available Commands:
255+
catalog Display one or many installed catalogs
256+
extension Display one or many installed extensions
257+
```
258+
<br/>
259+
260+
### olmv1 get catalog
261+
Display status information of all `ClusterCatalogs`.
262+
263+
```bash
264+
Display one or many installed catalogs
265+
266+
Usage:
267+
operator olmv1 get catalog [catalog_name] [flags]
268+
269+
Aliases:
270+
catalog, catalogs
271+
```
272+
273+
```bash
274+
$ kubectl operator olmv1 get catalog
275+
NAME AVAILABILITY PRIORITY LASTUNPACKED SERVING AGE
276+
operatorhubio Available 0 44m True 44m
277+
```
278+
<br/>
279+
280+
### olmv1 get extension
281+
Display status information of installed `ClusterExtensions`.
282+
283+
```bash
284+
Display one or many installed extensions
285+
286+
Usage:
287+
operator olmv1 get extension [extension_name] [flags]
288+
289+
Aliases:
290+
extension, extensions [extension_name]
291+
```
292+
293+
```bash
294+
$ kubectl operator olmv1 get extension
295+
NAME INSTALLED BUNDLE VERSION SOURCE TYPE INSTALLED PROGRESSING AGE
296+
test-operator prometheusoperator.0.47.0 0.47.0 Community Operators Index True False 44m
297+
```

0 commit comments

Comments
 (0)