Rukpak
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Embedded Bundle Support ## Pre-Requisite Work - [Bundle and ConfigMap Immutability](https://github.com/operator-framework/rukpak/pull/157/) ## Summary Introduce support for embedding Bundle's within the BundleInstance (BI) API so users and higher level controllers can interact with a single API in the rukpak stack. The BI API will be updated to support the dynamic creation of Bundle resources through this embedding mechanism. > Supporting the static and dynamic creation of Bundle resources is considered out-of-scope for this design due to current UX concerns around this bi-lateral behavior. When a user creates a BI resource, and that resource contains a reference to an embedded Bundle, all provisioners that implement the BI API are responsible for creating the Bundle according to the desired specification. The Bundle controller is still responsible for sourcing and unpacking Bundle resources. In the case the Bundle has already been generated, the BI controller is responsible for ensuring that the current state of the Bundle resource eventually matches the desired state of the embedded BundleSpec. The BI controller is also responsible for injecting owner references for generated, dependent Bundle resources. See the upstream issue [^1] for more details and discussion. ## Goals - Enable users and higher level controllers to interact with a single API - Embedded Bundles are garbage collected when a BundleInstance resource has been deleted - Embedded Bundles are garbage collected when a BundleInstance resource successfully pivots to a new Bundle resource ## Stetch-Goals - Support Bundle and BundleInstances referencing different provisioner unique IDs - Support more advanced rollout strategies when pivoting between Bundle resources ## Non-Goals - Support the static and dynamic creation of Bundle resources in the BI API - Support removing existing BundleInstance resources and adopting all their resources with new BundleInstances ## Proposal Enable the dynamic creation and management of Bundle resources by updating the BI API to mirror the core Deployment Kubernetes resource. This can be done through the introduction label selection and templating of embedded Bundles to the BI API. See [Examples](#Examples) for a concrete embedded Bundle reference. ### Go API Type Changes Update the BundleInstance API, and replace the `spec.BundleName` field with a custom `spec.Bundle` struct that closely resembles the core Deployment resource type definitions: ```go= // BundleInstanceSpec defines the desired state of BundleInstance type BundleInstanceSpec struct { // Label selector for Bundles. Existing Bundles that match this label // selector must match the label selector specified in the template field. Selector *metav1.LabelSelector `json:"selector"` // ProvisionerClassName sets the name of the provisioner that should reconcile this BundleInstance. ProvisionerClassName string `json:"provisionerClassName"` // Template describes the generated Bundle that this instance will manage. // +kubebuilder:pruning:PreserveUnknownFields Template *BundleTemplate `json:"template"` } // BundleTemplate defines the desired state of a Bundle resource type BundleTemplate struct { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty"` // Specification of the desired behavior of the Bundle. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +optional Spec BundleSpec `json:"spec,omitempty"` } ``` ### Reconciliation Logic > Note: the following reconciliation logic is centered around rukpak's plain provisioner implementation. <!-- Validation of the label selector specified to avoid metav1.All scenarios? --> Update the plain provisioner's BI controller logic to get a list of Bundles that exist on cluster that match the BI's spec.Selector label selector value. For each of the Bundles returned, check whether any Bundle matches the desired spec.Template Bundle template value. In the case that multiple Bundles match the desired template, sort the list of Bundles by metadata.CreationTimestamp, and chose the Bundle that has the newest value. > Note: we may need to filer out spec.Template.Metadata values to properly compare the current and desired state When the controller is unable to find a Bundle that matches the desired specification, it's responsible for generating a new Bundle resource that matches the spec.Template values. When generating Bundle resources, use the BI's metadata.Name value and append a hash to avoid collision with existing Bundle names. Due to Bundle immutability, any Bundle that differs from the desired specification cannot be updated to match the Bundle template present in the BI resource. Instead, the BI controller is responsible for creating a new Bundle resource using the desired Bundle template, and waiting for that newly created Bundle resource to report an unpacked state before deleting the previous, out-of-date Bundle resource(s). In the future, the BundleInstance API may support more advanced pivoting or rolling mechanisms. ## Example(s) ### Embedded Git-based BundleInstance ```yaml= apiVersion: core.rukpak.io/v1alpha1 kind: BundleInstance metadata: name: combo spec: provisionerClassName: core.rukpak.io/plain selector: matchLabels: app.kubernetes.io/name: combo template: metadata: labels: app.kubernetes.io/name: combo spec: provisionerClassName: core.rukpak.io/plain source: git: ref: branch: main repository: https://github.com/operator-framework/combo type: git ``` ## Alternative Implementations ### BundleInstance supports embedding Bundles and existing Bundles This alternative design is centered around the BundleInstance API supporting the static and dynamic creation of Bundle resources. This approach would mirror behavior that's present in core Kubernetes with the PersistentVolume and PersistentVolumeClaim resources [^3] where users can provisioner volumes statically, or dynamically when referencing StorageClass resources that support dynamic volume provisioning. The BundleInstance API can be updated to use the same `spec.Bundle` custom structure, where only the `spec.Bundle.Name` is a required field. The BundleInstance controller would then be responsible for checking whether the nested `spec.Bundle.Spec` field has been specified by a user, and treat that resource as an embedded Bundle and dynamically manage that Bundle resource. Else, the controller would continue with the existing reconciliation behavior we've seen in the rukpak releases. This approach was ultimately rejected due to initial UX concerns. ### Bundles are mutable This alternative design takes into the same proposal detailed above, but instead of relying on Bundle/ConfigMap immutability as pre-requisite work, it treats Bundle resources as mutable entities. When the BI controller sees an existing, embedded Bundle resource, and the current state of the Bundle resource present on cluster doesn't match the desired spec outlined in the BI's spec.Bundle.Spec field, the controller attempts to update that Bundle resource with the updated spec. The Bundle controller would then be responsible for the unpacking and sourcing process. ### Introduce new API(s) Introduce a new API that combines both of these two rukpak API primitives [^2]. And this new API could aim to emulate the ReplicaSet or Deployment resource(s) seen in core Kubernetes: > Note: click the "details" tab to toggle the hidden YAML resources <details> ```yaml= apiVersion: core.rukpak.io/v1alpha1 kind: BundleInstanceSet ## Note: naming TDB metadata: name: combo spec: selector: matchLabels: app: combo bundle: template: metadata: name: combo spec: provisionerClassName: core.rukpak.io/plain source: type: git git: repository: https://github.com/operator-framework/combo ref: branch: main ``` </details> And that higher level API would get translated into the following, lower level rukpak resources: <details> ```yaml= apiVersion: core.rukpak.io/v1alpha1 kind: Bundle metadata: name: combo spec: provisionerClassName: core.rukpak.io/plain source: type: git git: repository: https://github.com/operator-framework/combo ref: branch: main --- apiVersion: core.rukpak.io/v1alpha1 kind: BundleInstance metadata: name: combo spec: provisionerClassName: core.rukpak.io/plain bundleName: combo ``` </details> This approach was ultimately rejected due the current intention that the BundleInstance API more resembles the responsibilities of the Deployment resource, vs. the BundleInstance API resembles a lower level core Kubernetes API like a Pod. [^1]: <https://github.com/operator-framework/rukpak/issues/73> [^2]: <https://github.com/operator-framework/rukpak/issues/73#issuecomment-1084728436> [^3]: <https://kubernetes.io/docs/concepts/storage/persistent-volumes/#provisioning>

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully