This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
How to implement approval workflows in Rukpak #367
joelanford
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There's an existing issue for this topic in #113, but I figured it might make sense to start a discussion while we explore this space since we have nothing concrete to do yet.
Background
RukPak is designed to handle installation and some aspects of lifecycling arbitrary bundles that can be applied to Kubernetes clusters. These bundles often contain cluster extensions which means that cluster administrators must have awareness of their contents to ensure that they are secure and cannot interfere with or introduce vulnerabilities to their cluster.
To ensure that cluster admins have this awareness, a naive solution is to give only trusted administrators the RBAC that is necessary to create and update bundle instances.
While this solution would work, it limits the ways that RukPak can be used. It forces cluster administrators to directly touch individual bundle instance objects in order to pivot them between versions. Some cluster admins would find this behavior compelling because it guarantees that no unintended changes are applied to the system.
However another class of cluster administrators may want to build automation that enables bundle instances to pivot between versions as new versions of their bundles become available. For example, a cluster administrator might wish to upgrade their bundle instances as soon as new security patches are available for them. It would be tedious for a cluster admin to a) know when security upgrades are available and b) check often enough to ensure their systems are net left vulnerable and c) manually update each bundle instance.
With this latter use case in mind, the Operator Lifecycle Manager project introduced APIs that enable the cluster to automatically receive, discover, and upgrade applications without administrator interaction:
CatalogSource
is an abstraction that allows OLM to find the set of available bundles to install. Catalogs are analogous to yum or apt repositories.Subscription
is (among other things) a declaration of a cluster users desire to install a package and keep it up-to-date.InstallPlan
is a realization of the set of packages to install.OLM currently has a course-grained approval flow that enables cluster users to:
There are several shortcomings in OLM's approval flow:
Lastly, approval is inherently imperative, so there are UX concerns with implementing an approval workflow in a Kubernetes API because Kubernetes APIs are declarative. Our solution needs to be mindful of this fact. Some questions in this area are:
Inspiration
I haven't looked much, but the closest thing I've found that seems applicable to our APIs is cert-manager's
CertificateRequest
API. It sits betweenCertificates
andIssuers
. A user creates aCertificate
for which the cert-manager controller creates aCertificateRequest
. An isssuer implementation does not act on aCertificateRequest
until it has been approved.Cert-manager has no opinion on what actually implements the approval of a
CertificateRequest
. It can be another controller that inspects theCertificateRequest
and automatically approves it, or it can be a human.Cert-manager defines a cluster role that approvers must have in order to be allowed to apply approvals or denials, and it implements the authorization using a validating webhook with a
SubjectAccessReview
(details can be found in the linked design doc)Applications in RukPak
RukPak is the lowest layer of bundle lifecycling. It is not involved in sourcing repository metadata or determining when upgrades are available. It is simply the abstraction layer that allows for simple installation of bundle content and pivots from one bundle to another.
The obvious way to implement approval in RukPak similar to the cert-manager design is to introduce a new API that sits between BundleInstances and Provisioners. A provisioner would not act on installing or pivoting a
BundleInstance
until itsBundleInstanceRequest
was approved.Is this the right layer for approval to work? Do we need multiple layers of approval (e.g. at higher levels of the API stack)? Deppy comes to mind as another API where some approval controls could be implemented. In the case of Deppy being used to generate a cluster-wide resolution of a set of compatible bundles, it probably does not make sense to allow some of those bundles to be upgraded but not others because that could cause incompatibilities between installed components. Some bundles may need to be upgraded in lock step in order to work properly.
Beta Was this translation helpful? Give feedback.
All reactions