Skip to content
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

Adopt bundle format for the Operator #128

Open
salv-orlando opened this issue May 4, 2021 · 0 comments
Open

Adopt bundle format for the Operator #128

salv-orlando opened this issue May 4, 2021 · 0 comments
Assignees

Comments

@salv-orlando
Copy link
Member

the NCP operator currently leverages the package manifest format.

We should move to the bundle format

the main difference is that while in package manifest format all the data are packaged in a zipfile, the bundle will instead be packages as a docker image.

As per the file structure, the contents are really the same, but organised in a slightly different manner. Since the image itself now provides versioning, it's not necessary anymore to store in-tree different data for different versions.

However, additional facilities must be added to build the bundle docker image:

  1. A bundle Dockerfile, which could be something like the following:

FROM scratch

LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=nsx-container-plugin-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.4.2
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v2
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
  1. A makefile target to build such bundle. This could be as simple as building the dockerfile above.

Please note the Dockerfile above contains some parameters that are specific to operator-sdk 1.4 and above. This version of the SDK operator includes facilities for generating all the needed bundle files using kustomize and kube-builder. For a similar example refer to the Antrea operator for Kubernetes.
However, rebuilding the NCP operator using a new SDK operator is a task that we can consider orthogonal to this issue. It will also require a non-negligible refactoring.
For the purpose of this issue we can probably just ensure that the operator CSV, the ncpinstall CRD, and the annotations yaml file are provided in a bundle director from which we will build the bundle image.

As for annotation, it should be ok to remove the one pertaining to kubebuilder.
However, for OCP certification, the following annotations should be added both to metadata and to bundle image labels:

  • com.redhat.openshift.versions for supported Openshift versions
  • com.redhat.delivery.operator.bundle: True (this just need to be there)

Example: https://github.com/vmware/antrea-operator-for-kubernetes/pull/25/files#diff-05b673b667f06134d9ecd4d5a022ad2cc1e125a50bc7df1bf3221d9cb9eb9010

@dantingl dantingl assigned dantingl and jwsui and unassigned dantingl May 6, 2021
jwsui added a commit to jwsui/nsx-container-plugin-operator that referenced this issue Jun 4, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
1. Generate CSV files with tool faq.
2. Build image contains CSV files.
3. Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
jwsui added a commit to jwsui/nsx-container-plugin-operator that referenced this issue Jun 4, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
jwsui added a commit to jwsui/nsx-container-plugin-operator that referenced this issue Sep 10, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
jwsui added a commit to jwsui/nsx-container-plugin-operator that referenced this issue Sep 10, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
jwsui added a commit to jwsui/nsx-container-plugin-operator that referenced this issue Sep 10, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
jwsui added a commit to jwsui/nsx-container-plugin-operator that referenced this issue Sep 12, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
jwsui added a commit that referenced this issue Sep 14, 2021
Issue #128: Adopt bundle format for the Operator
salv-orlando pushed a commit to salv-orlando/nsx-container-plugin-operator that referenced this issue Oct 14, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
salv-orlando pushed a commit to salv-orlando/nsx-container-plugin-operator that referenced this issue Oct 14, 2021
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants