-
Notifications
You must be signed in to change notification settings - Fork 125
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
[Proposal] Add support to OLM bundle format #703
Open
varshaprasad96
wants to merge
1
commit into
carvel-dev:develop
Choose a base branch
from
varshaprasad96:proposal/add-olm-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
79 changes: 79 additions & 0 deletions
79
proposals/kapp-controller/004-registryV1-bundle-support/README.md
This file contains 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,79 @@ | ||
--- | ||
title: "Adding support to handle OLM registryV1 bundles" | ||
authors: [ "Varsha Prasad Narsing <[email protected]>" ] | ||
status: "in review" | ||
approvers: [ <TBD_Carvel Maintainers> ] | ||
--- | ||
|
||
# Adding support to handle OLM registryV1 bundles | ||
|
||
## Problem Statement | ||
|
||
[Operator Lifecycle Manager][olm_doc] (OLM) is a tool that helps manage the lifecycle of operators. Some key aspects of the tool are: catalog management, installation, upgrade, dependency resolution, content discovery. It currently uses a custom packaging format called `registry+v1`. This is an OCI image with a particular directory structure, more details on which can be found [here][olm_manifest_format]. A subset of operator packages available in `registry+v1` format can be found at https://operatorhub.io/. | ||
|
||
Kapp-controller currently does not support installing packages following OLM's `registry+v1` format. Adding support for it, will enable kapp-controller to install and manage contents of the operators that are available in the OLM supported format. | ||
|
||
## Proposal | ||
|
||
### Goals and Non-goals | ||
|
||
### Goals | ||
|
||
1. Enable operators packaged for OLM to be installed (and reconciled) by kapp-controller through `App` CR. | ||
|
||
### Non-Goals | ||
|
||
This proposal does not discuss: | ||
1. The intention behind `registry+v1` packaging structure. | ||
2. The contents of operator bundle which the kapp-controller will install when this feature is available. | ||
|
||
### Specification | ||
|
||
We intend to add support for the `registry+v1` format during the templating step by modifying the `App` API's spec. On introducing this, the overall process would look like: | ||
|
||
1. Consume the contents of App's `spec.fetch.image` which could point to a `registry+v1` image. | ||
|
||
2. Process the `registry+v1` bundle with the help of specific fields introduced in App's `spec.template` section. | ||
|
||
The API definition would look like: | ||
|
||
```go | ||
// +k8s:openapi-gen=true | ||
type AppTemplate struct { | ||
OLMRegistry *AppTemplateOLMRegistry `json:"olmRegistry,omitempty"` | ||
} | ||
|
||
type AppTemplateOLMRegistry struct { | ||
// BundleRoot is the path to bundle root within the source directory. | ||
// Default is the source directory root (optional). | ||
BundleRoot string `json:"bundleRoot,omitempty" protobuf:"bytes,1,opt,name=bundleRoot"` | ||
|
||
// TargetNamespaces is the list of namespaces that the bundle will be configured to target. | ||
// If the bundle supports AllNamespaces mode, default is all namespaces. Otherwise, if the | ||
// bundle supports OwnNamespaces mode, it will default to install namespace. If the bundle supports neither | ||
// AllNamespaces nor OwnNamespace, TargetNamespaces must be specified. | ||
TargetNamespaces []string `json:"targetNamespaces,omitempty" protobuf:"bytes,2,opt,name=targetNamespaces"` | ||
} | ||
``` | ||
|
||
With the help of the following inputs, kapp-controller can then convert the registry+v1 contents into a set of plain kubernetes manifests. | ||
|
||
### Templating overview: | ||
|
||
At a high level, a `registry+v1` package contains: | ||
1. Cluster Service Version (CSV) - A yaml that represents a particular version of a running kubernetes operator on a cluster. It includes metaqdata such as name, description, version, repository link, labels, icon etc. | ||
2. `annotations.yaml` - Contains operator metadata information as labels that are used to annotate the `registry+v1` image. More details can be found [here][bundle_contents]. | ||
3. Dockerfile - Used to build an image for the bundle. | ||
4. CRDs relevant to the Operator. | ||
|
||
With the help of the metadata provided in `CSV` and `annotations.yaml`, a set of plain kubernetes manifests can be generated and provided to the `kapp` deployer to apply them onto the cluster. | ||
|
||
## Open Questions | ||
|
||
1. Are there any unintended consequences of introducing these API changes to other components of kapp-controller? | ||
|
||
|
||
[olm_manifest_format]: https://github.com/operator-framework/operator-registry#manifest-format | ||
[olm_doc]: https://olm.operatorframework.io | ||
[bundle_contents]: https://olm.operatorframework.io/docs/tasks/creating-operator-bundle/#contents-of-annotationsyaml-and-the-dockerfile | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a little bit more details need to be added on how kapp-controller can convert this into plain Kubernetes manifests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praveenrewar The conversion between OLM's registryV1 to plain k8s manifest is based on a yaml named "ClusterServiceVersion" - CSV (https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion/). There is a direct 1 on 1 translation - which means that based on the info given specified in a CSV yaml (like deployment spec and permissions) we create individual ClusterRoles, service accounts, Bindings, Deployments etc.