Coder Social home page Coder Social logo

Package the Build API - without OLM about build HOT 8 OPEN

sbose78 avatar sbose78 commented on August 18, 2024
Package the Build API - without OLM

from build.

Comments (8)

zhangtbj avatar zhangtbj commented on August 18, 2024 2

Thanks for the analysis.

I like the option 2 and also hope to see a dedicated Build Operator in the OperatorHub :)

from build.

zhangtbj avatar zhangtbj commented on August 18, 2024

I think the lifecycle for Controller and Operator are different.

If it is an Operator, like Tekton Operator, then you can manage the controller and CRDs inside of the Operator, update or do something or it.

But I think for this repo, it is a build controller, it include the function logic, doesn't include the operation logic.

If there is no easy way, I think like other controllers, we can document in README that let user how to install or update it. And the operation team will handle that.

like our side, our admin manages the controller lifecycle by using Concourse pipeline, if there is any Git release is published. the pipeline will redo the deploy steps:
kubectl apply -f deploy/crds/
kubectl apply -f deploy/
etc ....
to update the crds and controller with new image

from build.

qu1queee avatar qu1queee commented on August 18, 2024

So what we call an operator is just code that creates and initialize controllers(via the manager). From my experience, is a best practice to allow the operator also to generate on the fly & install the required controllers CRDs. I guess this is why the Tekton Operator does it, and I would prefer that this build operator does the same. I think is better to reduce dependencies prior to the build operator initialization.

Iยดm not sure if the above is a lifecycle management of CRDs. I think is not, while it just installs them, and any future CRD definition change, will imply a restart of the operator.

@sbose78 if you are behind a controller life-cycle managent, I think you need a helm chart. And to be able to package the operator into an image, for versioning it. The chart should reference it, and the user should be able to define what version of the operator he/she wants based on image digest(or similar).

I might be missing something here, so please keep me honest.

from build.

qu1queee avatar qu1queee commented on August 18, 2024

Also, what about an image mechanism(store in registry with some semantic versioning), if the helm chart is too much. Or is this something already in place?

from build.

sbose78 avatar sbose78 commented on August 18, 2024

Thanks!

What

So here are the things that need to "managed and lifecycle'd":

  1. A builder or pipeline Service Account: A default service account created in every namespace which Builds would run as. It is similar to

    • the builder sa[1] in OpenShift, Or
    • the pipeline sa which OpenShift Pipelines sets up for us in every namespace. I've documented the manual steps[2] to set it up today, Or
    • Of course, we have the default sa in every namespace in kubernetes that can be used.
  2. Controller image: The image which runs the controllers we have in this repo.

  3. CRDs ( 3 or 4 CRDs ).

  4. [Cluster]Rolebindings , [Cluster]Roles & Service account the controller would run as.

(1), (2) & (3) as a whole bundle needs to be versioned and managed by something on the cluster.

[1] https://docs.openshift.com/container-platform/3.6/dev_guide/service_accounts.html#default-service-accounts-and-roles
[2] https://github.com/redhat-developer/build/blob/master/HACK.md#running-the-operator

Option 1: OLM packaging everything and installing on your behalf

๐Ÿ‘ OLM can manage bundles like (1) (2) and (3) as a whole. Example https://github.com/sbose78/buildv2-olm-csv-sample/blob/master/0.0.4/buildv2-operator.v0.0.1.clusterserviceversion.yaml

๐Ÿ‘ Just like typical package managers, OLM has a way to define dependencies. https://github.com/operator-framework/operator-lifecycle-manager/blob/master/README.md#dependency-resolution

๐Ÿ‘Ž The tekton operator isn't on Operatorhub yet, hence dependency resolution doesn't happen for free. https://github.com/tektoncd/operator

Option 2: A dedicated operator for packaging and installing artifacts

๐Ÿ‘ We tag and create a release.yaml at frequent intervals ( like tekton )

๐Ÿ‘ A dedicated operator for setting things up. I would typically keep the "business logic" controllers separate from the one that sets those up.

From my experience, is a best practice to allow the operator also to generate on the fly & install the required controllers CRDs

Based on my analysis, I like option 2 :)

And, I think I'm going to anyway submit 'Option 2' to the list of Kubernetes operators on operatorhub.io https://github.com/operator-framework/community-operators/tree/master/upstream-community-operators but that will not affect your custom way of managing this dedicated operator if you wanted to have a custom way.

( more to be added )

from build.

sbose78 avatar sbose78 commented on August 18, 2024

Of course, we have the default sa in every namespace in kubernetes that can be used.

#77

from build.

sbose78 avatar sbose78 commented on August 18, 2024

tektoncd/operator#3 I see that adding the upstream tekton operator is marked as important/soon

If that's done, then we have this easy operatorhub experience too https://www.youtube.com/watch?v=M90IKYKm2aI which is feasible on OpenShift ( https://github.com/sbose78/buildv2-olm-csv-sample/blob/master/0.0.5/buildv2-operator.v0.0.1.clusterserviceversion.yaml#L15 )

from build.

qu1queee avatar qu1queee commented on August 18, 2024

I like also option 2! thanks for the detail explanation!

from build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.