jkimmel-vmware
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Package Version Constraints in kapp-controller ## Problem: Not all Packages work equally with all versions of Kubernetes and/or kapp-controller ### Supporting context: * For Fork 1: * https://github.com/vmware-tanzu/carvel-kapp-controller/issues/484 * https://github.com/vmware-tanzu/carvel-kapp-controller/issues/577 * For Fork 2: * https://github.com/vmware-tanzu/carvel-kapp-controller/issues/781 * Additionally (no issue), we've heard the use-case that while a package may be compatible with a given version of k8s, it might need to conditionally enable/disable some things (e.g. k8s-provided CRs or even specific Packaging API features) ### Additionally: We may eventually implement other package management features around version requirements. For example we could interpret version range constraints in a PackageInstall in combination with Package level compatibility constraints to select "the largest version in the specified range that is still compatible with the cluster's version of kubernetes." ## Proposal :rocket: :::success **A Two Pronged Solution** :fork_and_knife: 1.) Add to Package spec fields: range selection for kubernetes and kapp-controller version :fork_and_knife: 2.) Expose current versions of kapp-controller and kubernetes to the templating phase via Downward API ::: ### Proposal Part 1: New fields in Package spec ``` --- apiVersion: data.packaging.carvel.dev/v1alpha1 kind: Package metadata: [...] spec: kubernetesVersionSelection: constraints: ">v1.19.3" kappControllerVersionSelection: constraints: ">v1.23.99" [...] ``` ##### Package Install Override Annotation ``` packaging.carvel.dev/ignore-kubernetes-version-selection: "" packaging.carvel.dev/ignore-kapp-controller-version-selection: "" ``` these annotations allow package consumers to override any version constraints specified in the package at their discretion. #### Description - all range fields are optional, and if unspecified you're just good indefinitely - a PackageInstall referencing a package will fail to reconcile if the cluster k8s version or kc version is outside your specified requirements #### Questions - ~~would you rather specify a range similar to how we do version constraints?~~ - ~~Are there other things you would want to constrain at this level?~~ ### Concerns ~~- version range will be more flexible in terms of allowing someone to exclude a specific version~~ - ~~if we shut down an installation based on version will we be locking somebody out of installing a package that would actually work based on feature gates / specific config. Where's the override?~~ - ~~should we even allow packages to exist on a system where they are marked incompatible? Who is wiser: the package author or the package consumer?~~ ### Proposal Part 2: New Data in Downward API ``` downwardAPI items: - name: myK8sVersionName kubernetesVersion: {} - name: myNameForkcVersion kappControllerVersion: {} - name: myNameForAPICapabilities clusterAPIs: {} ``` in particular, clusterAPIs should be compatible with how Helm presents that data currently, ([]string{"group/version", "group/version", ...}) see e.g. https://github.com/helm/helm/blob/d84655a9c527e090d2f50ed097beebf3aeed0421/pkg/chartutil/capabilities.go#L103 template specific examples: ``` helmTemplate: valuesFrom: # type Values.AsPaths() helm template -f .... --kube-version ... --api-versions x - secretRef: ... - configMapRef: ... kubernetesVersion: {} kubernetesAPIs: {} ytt: valuesFrom: # ytt [-f ...] - downwardAPI: items: - name: foo fieldPath: ... - name: kube_version kubernetesVersion: {} # default will pull from network but could also be user-provided e.g. {1.2.3} - name: kube_apis kubernetesAPIs: {} ``` #### Description kapp-controller's downward API was recently introduced into develop (not yet in any release) and works similar to the k8s downward API: We make available certain information from the metadata of the AppCR to the template step. ([see develop branch App CR docs](https://carvel.dev/kapp-controller/docs/develop/app-spec/) for more). Here we add two new pieces of information: the current version of kapp-controller and of kubernetes itself, and allow the user to specify a name to bind that data to which can then be used during templating. This would allow users to create conditionals during templating that are sensitive to e.g. the current kubernetes version. ##### Implementation details For helm, expose `kubernetesVersion: {}` and `kubernetesAPIs:{}` bc those correspond to flags we'll pass in to the helm template. Then we'll have the items still in the downwardsAPIs for the other templaters (and technically helm though wouldn't expect anyone to ever use) #### Questions - ~~The k8s downward API uses two values on the left-hand side: "fieldpath" and "resource." Here we present two options for discussion/feedback:~~ - ~~a pseudo value "source" on LHS with the magic value "carvel.kubernetesVersion" on the RHS, or~~ - ~~the magic string "carvel.kubernetesVersion" on the LHS and a dummy "true" value on the RHS.~~ - ~~are there other similar data points you think we should make available via this mechanism? (A: yes, helm capabilities / APIs)~~ #### discussion / concerns - ~~eventually we could make other info available re APIs on the cluster (see e.g. helm built in capabilities)~~ - ~~for helm template could we _always_ pass in the k8s version as this value? (pass it in via helm capabilities) (ytt & cue would be data value)~~ - so then should it still be in items part of downward API or some additional section that allows you to inject things into the helm capabilities - (see also: https://github.com/helm/helm/pull/5392) - ~~do we pull this out every time we reconcile? that comes with a cost bc we're goign to pull it from the server API, and not all helm templates will use it. So keeping it opt-in is an optimization. user has to explicitly request. helm template has kube-version and api-versions flags that we can leverage.~~ --- ## Additional Concerns - Ensure we get multi-cluster scenarios right: if there is a version mismatch between the management cluster and the destination workload cluster, we'd want to take the workload cluster's k8s version. (h/t Graham) ## Timeline this work is hopefully not controversial and might be started as early as July 11, pending feedback and discussion.

    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