You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/design/operator-bundle.md
+50-11
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Operator Bundle
1
+
overwrite# Operator Bundle
2
2
3
3
An `Operator Bundle` is a container image that stores Kubernetes manifests and metadata associated with an operator. A bundle is meant to present a *specific* version of an operator.
4
4
@@ -87,7 +87,7 @@ In order to use Operator SDK CLI, follow the operator-SDK installation instructi
87
87
88
88
1. Install the [Operator SDK CLI](https://github.com/operator-framework/operator-sdk/blob/master/doc/user/install-operator-sdk.md)
89
89
90
-
Now, a binary named `operator-cli` is available in OLM's directory to use.
90
+
Now, a binary named `operator-sdk` is available in OLM's directory to use.
91
91
```bash
92
92
$ ./operator-sdk
93
93
An SDK for building operators with ease
@@ -106,11 +106,29 @@ Use "operator-sdk [command] --help" for more information about a command.
106
106
```
107
107
108
108
### Generate Bundle Annotations and DockerFile
109
+
*Notes:*
110
+
* If there are `annotations.yaml` and `Dockerfile` existing in the directory, they will be overwritten.
109
111
110
-
Using `operator-sdk` CLI, bundle annotations can be generated from provided operator manifests. The command for `generate`task is:
112
+
Using `operator-sdk` CLI, bundle annotations can be generated from provided operator manifests. The overall `bundle generate`command usage is:
The `--directory` or `-d` specifies the directory where the operator manifests are located. The `Dockerfile` is generated in the same directory where the YAML manifests are located while the `annotations.yaml` file is located in a folder named `metadata`. For example:
115
133
```bash
116
134
$ tree test
@@ -124,22 +142,43 @@ test
124
142
└── Dockerfile
125
143
```
126
144
127
-
*Notes:*
128
-
* If there are `annotations.yaml` and `Dockerfile` existing in the directory, they will be overwritten.
145
+
The `--package` or `-p` is the name of package fo the operator such as `etcd` which which map `channels` to a particular application definition. `channels` allow package authors to write different upgrade paths for different users (e.g. `beta` vs. `stable`). The `channels` list is provided via `--channels` or `-c` flag. Multiple `channels` are separated by a comma (`,`). The default channel is provided optionally via `--default` or `-e` flag. If the default channel is not provided, the first channel in channel list is selected as default.
146
+
147
+
All information in `annotations.yaml` is also existed in `LABEL` section of `Dockerfile`.
129
148
130
149
### Build Bundle Image
131
150
132
-
Operator bundle image can be built from provided operator manifests using `build` command:
151
+
Operator bundle image can be built from provided operator manifests using `build` command (see *Notes* below). The overall `bundle build` command usage is:
The `--directory` or `-d` specifies the directory where the operator manifests are located. The `--tag` or `-t` specifies the image tag that you want the operator bundle image to have. By using `build` command, the `annotations.yaml` and `Dockerfile` are automatically generated in the background.
137
173
138
174
The default image builder is `Docker`. However, ` Buildah` and `Podman` are also supported. An image builder can specified via `--image-builder` or `-b` optional tag in`build` command. For example:
The `--package` or `-p` is the name of package fo the operator such as `etcd` which which map `channels` to a particular application definition. `channels` allow package authors to write different upgrade paths fordifferent users (e.g. `beta` vs. `stable`). The `channels` list is provided via `--channels` or `-c` flag. Multiple `channels` are separated by a comma (`,`). The default channel is provided optionally via `--default` or `-e` flag. If the default channel is not provided, the first channelin channel list is selected as default.
180
+
143
181
*Notes:*
144
-
* If there are `annotations.yaml` and `Dockerfile` existing in the directory, they will be overwritten.
145
-
* The directory where the operator manifests are located must must be inside the context of the build which in this case is inside the directory where you run the command.
182
+
* If there is `Dockerfile` existing in the directory, it will be overwritten.
183
+
* If there is an existing `annotations.yaml`in`/metadata` directory, the cli will attempt to validate it and returns any found errors. If the ``annotations.yaml`` is valid, it will be used as a part of build process. The optional boolean `--overwrite/-o` flag can be enabled (false by default) to allow cli to overwrite the `annotations.yaml`if existed.
184
+
* The directory where the operator manifests are located must be inside the context of the build which in this case is inside the directory where you run the command.
0 commit comments