|
| 1 | +# Porch Roadmap |
| 2 | + |
| 3 | +This document outlines next steps for Porch in several areas. This is a living |
| 4 | +document outlining future direction and work in different Porch subsystems. |
| 5 | + |
| 6 | +## API Changes |
| 7 | + |
| 8 | +* Expression kpt function type 'signature', including: |
| 9 | + * types of resources the function acts on |
| 10 | + * schema of the function config |
| 11 | + * types of resources the function _produces_ (if the function introduces new |
| 12 | + resources into the configuration package) |
| 13 | +* Add `Package` resource to encapsulate all `PackageRevision`s of the same |
| 14 | + package, link to the latest `PackageRevision`. Possibly the `Package` resource |
| 15 | + can allow mutation of the package or its contents, and automatically create |
| 16 | + new (_Draft_) `PackageRevision` resources on mutations. |
| 17 | +* Implement support for API-level filtering (field and label selectors) for all |
| 18 | + `list` operations. |
| 19 | +* Implement support for k8s API primitives such as `Watch`, correct use of all |
| 20 | + `ObjectMeta` fields. |
| 21 | +* Make sure that all errors translate to the appropriate API-level HTTP status |
| 22 | + with clear, actionable messages. |
| 23 | + |
| 24 | +## Repository Management |
| 25 | + |
| 26 | +* Support for specifying repository-wide, default _upstream_ repository which |
| 27 | + would become the default upstream repository for cloned packages |
| 28 | +* Repository-wide guardrails - functions registered with the repository that |
| 29 | + then are evaluated on packages in that repository whenever those packages |
| 30 | + change. |
| 31 | +* Support updating repository registration, for example when `Repository` |
| 32 | + resource is modified to point to a different repository, or even a different |
| 33 | + type of a repository (Git --> OCI). |
| 34 | +* Implement repository cache eviction policy |
| 35 | +* Support `ObjectMeta.GenerateName` for `PackageRevision` creation. Currently |
| 36 | + package names are computed as <repository>-<sha>. Ideally Porch would accept |
| 37 | + name prefix (constrained for example to the last segment of the package name) |
| 38 | + as `GenerateName` value, for example `istions` and Porch would append the SHA. |
| 39 | + This will require creating an inverse mapping from package name to its owning |
| 40 | + repository. Currently the inverse mapping is encoded in the package name, |
| 41 | + whose format is `<repository name>-<package name hash>`. |
| 42 | +* Error-resilient repository ingestion (some erroneous packages in the |
| 43 | + repository should not prevent repository from successfully loading). |
| 44 | +* Make the background repository routine a controller to leverage functionality |
| 45 | + in the common controller libraries, such as maintaining reliable `Watch` |
| 46 | + connection (`background.go`). |
| 47 | +* Enable OCI repositories with heterogeneous contents (containing both |
| 48 | + `Package` and `Function` resources)? |
| 49 | +* Improve synchronization of repository actions to avoid simultaneous repository |
| 50 | + fetches and repository access that requires synchronization. |
| 51 | + |
| 52 | +### Git |
| 53 | + |
| 54 | +* Support for additional authentication schemes (ssh keys, GCP service account), |
| 55 | + as required to enable integration with additional Git providers such as |
| 56 | + [Cloud Source Repositories](https://cloud.google.com/source-repositories/docs) |
| 57 | +* Support authentication for cloning packages from unregistered repositories. |
| 58 | +* Porch will need to store more information associated with a package revision, |
| 59 | + for example: |
| 60 | + * information about the package's error status (to populate the `status` |
| 61 | + section of the PackageRevision API resource)) |
| 62 | + * rationale for rejection proposal to publish a package |
| 63 | + |
| 64 | + We will need to utilize Git repository or some auxiliary storage (git is |
| 65 | + preferred because it also propagates information across Porch instances) |
| 66 | + and we can consider: |
| 67 | + * storing the information in a HEAD draft commit. When draft is updated, |
| 68 | + Porch would drop this HEAD commit, stack more mutation commits and then |
| 69 | + add a new HEAD commit with additional meta information |
| 70 | + * using separate 'meta' branches |
| 71 | + * Git notes (though these are attached to object ) |
| 72 | +* Implement appropriate caching when cloning packages from unregistered |
| 73 | + repositories (currently, those repositories are fetched and immediately |
| 74 | + deleted)) |
| 75 | + |
| 76 | +## OCI |
| 77 | + |
| 78 | +* Complete the OCI support (current implementation is partial, missing package |
| 79 | + lifecycle support, cloning from OCI repository is not supported, etc.) |
| 80 | +* Support for authentication methods as required by integration with specific |
| 81 | + OCI repository providers. Currently Porch authenticates as the workload |
| 82 | + identity GCP service account which works well with Google Container Registry |
| 83 | + and Artifact Registry; different methods will likely be needed for other |
| 84 | + providers. |
| 85 | + |
| 86 | +## Engine |
| 87 | + |
| 88 | +* Create a unified representation of a package and its contents in the system. |
| 89 | + Porch Engine currently stores package contents as `map[string]string` (file |
| 90 | + name --> file contents, see `PackageResources` type) and kpt intrinsic |
| 91 | + algorithms work with `kyaml filesys.FileSys` interface, necessitating |
| 92 | + translation. Ideal representation would help minimize the need to not only |
| 93 | + translate the representation at the macro level but also reduce need for |
| 94 | + repeated parsing and serialization of YAML. |
| 95 | +* Support package contents that are not text |
| 96 | +* Revisit package update mutation to avoid using local file system and integrate |
| 97 | + better with CaD library (`updatePackageMutation.Apply`). |
| 98 | + |
| 99 | +## Package Lifecycle |
| 100 | + |
| 101 | +* Ensure that all operations can be performed only on package revision in the |
| 102 | + appropriate lifecycle state (example: only _Published_ packages can be cloned, |
| 103 | + deployed, etc.) |
| 104 | +* Support detection of new version of upstream package and downstream package |
| 105 | + update |
| 106 | +* Support sub-packages |
| 107 | +* Handling of merge conflicts, assistance with manual conflict resolution |
| 108 | +* Bulk package operations (bulk upgrade from updated upstream package) |
| 109 | +* Permission model to enable admins more fine-grained control over repository |
| 110 | + access than what it supported by underlying Git or other providers |
| 111 | + |
| 112 | +## CLI Integration |
| 113 | + |
| 114 | +* Support for registering repository-wide guardrails - mutators or validators. |
| 115 | +* Support for updating repository registration (currently only `register`, |
| 116 | + `unregister`, and `get` are implemented) |
| 117 | +* On repository unregistration, the CLI can check all other registered |
| 118 | + repositories and suggest to the user to keep or delete the secret containing |
| 119 | + credentials depending on whether other repository registrations use it or |
| 120 | + the last one is being deleted; today, a `--keep-auth-secret` flag is used. |
| 121 | +* Registration of _function_ repositories (only _package_ repositories are |
| 122 | + currently supported in the CLI). |
| 123 | +* Function discovery via in registered function repositories. |
| 124 | +* Consider revising the structure of the `kpt alpha` command groups. `kubectl` |
| 125 | + organizes the groups by action, for example `kpt get <resource>` whereas |
| 126 | + `kpt` by resource: `kpt alpha rpkg get`. Consider `kpt alpha get rpkg` or |
| 127 | + `kpt alpha get repo` for consistency with `kubectl` experience. |
| 128 | +* Implement richer support for referencing to packages by URLs with proper |
| 129 | + parsing, reduce number of command line flags required. For example, support: |
| 130 | + `https://github.com/org/repo.git/packge/patch@reference`; Make the parsing |
| 131 | + code reusable with the rest of kpt CLI. |
| 132 | + |
| 133 | +## Testing |
| 134 | + |
| 135 | +* Enable the e2e tests to run against a specified Git repository |
| 136 | +* Accept Git test image as an argument to avoid requiring the Porch server |
| 137 | + image and Git test server image to share the same tag |
| 138 | + (see `InferGitServerImage` function and `suite.go` file) |
| 139 | + |
| 140 | +## Broader Changes |
| 141 | + |
| 142 | +* Support non-KRM content as part of `ResourceList` to allow lossless package |
| 143 | + transformations, or compensate for lack of this support in general by enabling |
| 144 | + in Porch partial package revision `pull` and `push`. |
| 145 | +* Make it possible for `R*Sync` resources to be created in arbitrary namespace |
| 146 | +* Enable `R*Sync` to sync both namespaced and non-namespaced resources |
| 147 | +* Improve the overall deletion flow, possibly implement it as: |
| 148 | + - deleting a package means creating a new revision of the package emptied |
| 149 | + of content |
| 150 | + - rolling out the updated package (this will delete the deployed resources) |
| 151 | + - delete the configuration package from repository completely |
| 152 | +* Reconcile Porch `RemoteRootSync` controller with Config Sync. |
| 153 | +* Create a rollout controller to drive cross-cluster deployment activity. |
0 commit comments