-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Doc: Adding documentation for multi-arch operators #5178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "Advanced Topics" | ||
linkTitle: "Advanced Topics" | ||
weight: 9 | ||
date: 2021-10-05 | ||
description: > | ||
Advanced Topics. | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: Multiple Architectures | ||
linkTitle: Multiple Architectures | ||
weight: 80 | ||
--- | ||
|
||
### Supporting Multiple Architectures | ||
|
||
Authors may decide to distribute their bundles for various architectures: x86_64, aarch64, ppc64le, s390x, etc, to accomodate the diversity of Kubernetes clusters and reach a larger number of potential users. Each architecture requires however compatible binaries. | ||
|
||
#### Manifest lists | ||
|
||
The most straightforward way of building operators and operands supporting multiple architectures is to leverage manifest lists, specified by [Image Manifest V2, Schema 2][manifest_list] or [OCI Image Index][image_index]. A manifest list points to specific image manifests for one or more platforms. | ||
|
||
For convenience tools like [buildah][buildah] allow to cross-build and manifest multi-arch containers on one host. For instance with buildah: | ||
|
||
```shell | ||
for a in amd64 arm64 ppc64le s390x; do \ | ||
buildah bud --manifest registry/username/repo:v1 --arch $a; \ | ||
done | ||
``` | ||
|
||
This creates the manifest list, builds each image and adds them to the manifest list. | ||
|
||
The result can then be pushed to the desired registry. | ||
|
||
```shell | ||
buildah push registry/username/repo:v1 | ||
``` | ||
|
||
Docker with [buildx][buildx] provides similar capabilities. | ||
|
||
```shell | ||
docker buildx build --push --platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x --tag registry/username/repo:v1 . | ||
``` | ||
|
||
See [docker documentation][buildx_multiarch] for additional options. | ||
|
||
**Caveats**: the Dockerfile generated by the SDK for the operator explicitely references GOARCH=amd64 for go build. This can be amended to GOARCH=$TARGETARCH. Docker will automatically set the environment variable to the value specified by --platform. With buildah --build-arg will need to be used for the purpose. | ||
|
||
**Caveats**: When mirroring registries for disconnected installations (environments without internet connection) all the images referenced by a manifest list need to be copied, including images for architectures that may not be used in the environment. | ||
|
||
#### Operator Lifecycle Manager | ||
|
||
For operators distributed through the [Operator Lifecycle Manager (OLM)][olm]: | ||
|
||
* [Bundle images][bundle] are not architecture-specific. They contain only plaintext kubernetes manifests and operator metadata. | ||
* All image references in the ClusterServiceVersion should be manifest lists containing the pointers to the image manifests for the supported architectures. | ||
* Labels for OS and architectures can be set in the CSV. Please refer to the [Operator Lifecycle Management Documentation][olm_multiarch] for details. | ||
|
||
[manifest_list]: https://docs.docker.com/registry/spec/manifest-v2-2/#manifest-list | ||
[image_index]: https://github.com/opencontainers/image-spec/blob/main/image-index.md | ||
[buildah]: https://github.com/containers/buildah/blob/main/docs/buildah-bud.md#building-an-multi-architecture-image-using-a---manifest-option-requires-emulation-software | ||
[buildx]: https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images | ||
[buildx_multiarch]: https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images | ||
[olm]: https://olm.operatorframework.io/docs/ | ||
[bundle]: https://olm.operatorframework.io/docs/glossary/#bundle | ||
[olm_multiarch]: https://olm.operatorframework.io/docs/advanced-tasks/ship-operator-supporting-multiarch/#multiple-architectures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: "Best Practices" | ||
linkTitle: "Best Practices" | ||
weight: 9 | ||
weight: 10 | ||
description: > | ||
Best practices, conventions and recommendations to work with SDK | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: How to Contribute | ||
linkTitle: Contribution Guide | ||
weight: 10 | ||
weight: 11 | ||
description: Contribute to Operator SDK | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.