kpt should support advanced package update workflows
Trying to capture two CUJs related to package update scenario and looking for feedback.
Package update workflow
namespace provisioning user guide features day 0 user journey for platform and application teams. This doc describes the day 2 user journey for for platform and application teams for namespace provisioning use-case.
If you completed the day 0 journey in the guide, then they will have following setup:
day 0
- An abstract package
basensin the blueprint repository at a version sayv4. - A few deployable instances of
basensin the deployment repository with different initial upstream versionsv3,v4.
day 2
- Abstract
basenspackage is updated in following ways and new versionv5is pushed:- New resources say
network policywith defaults is added. - Some changes in an existing resource
quotaare made.
- New resources say
- In
Config as dataUI:- For deployable instances on version
v3, UI should show that an updatev3 --> v5is available. - For deployable instances on version
v4, UI should show that an updatev4 -->v5is available. - On the
abstractpackage, UI should show affecteddeployable instancesthat needs to be updated to new version. A bulk operation to push the update to alldeployable instances. Generally bulk action will be initiated after rolling/testing the update on a few individualdeployable instances.
- For deployable instances on version
- In
kpt CLI:-
kpt alpha rpkgshould implement similiar workflow listed for the UI above. - It will be nice to have following enhancements to
kpt pkg update:-
kpt pkg update --show-available-versionsthat shows available versions.
-
-
- Being able to preview or
dry-runthe update operation will be a great UX without agitPR will be a great UX.
Enforcing guardrails on downstream packages
The platform teams want to enforce guardrails for downstream packages. Let's make this more concrete in context of the namespace provisioning example. The platform teams want to enforce that all deployable instances of basens package should have a network policy that allows selective ingress traffic (i.e. disallow all ingress traffic except a few ports). basens package can have a validator function in its Kptfile but that assumes that the deployable instances will keep the validator function the Kptfile. Application team can manually remove the validator function either intentionally or accidentally and violations can go unchecked in that case.
There are a few ways to go about it:
-
admission controlfunctionality at the repository level: platform teams can register set of functions at the repo level (deployment repoin this case) and whenever any package is modified throughporch, the registered functions will be invoked on the package to enforce the guardrails. This obviously requires users to useporch. -
package levelworkflow: This isn't super clear yet, but high level goal is that an upstream package (abstractpackage in this case) can constraint rendering workflow (especially validation) for a downstream package (deployable instances) (similar to inner mechanism https://www.cs.utah.edu/plt/publications/oopsla04-gff.pdf Thanks @bgrant0607 for reference). So we want to explore if concept of these guardrails can be baked natively in thekpt packageworkflow or not.
/cc @bgrant0607 @justinsb @mortent
As a consumer, I might deploy the package in a dev/personal cluster and I might not need all the guardrails. Each team might want to do the enforcement differently. So if someone really wants guardrails, it is preferable to do it at the cluster level. Possibly kpt can have a utility to generate the manifest for the admission control.
We are looking at injecting guardrails at the level of a registered repo in porch.
Repo level guardrails: #3279