From 2290adc2ba5e5afa36e555a1099ec32d01e7ba29 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Tue, 29 Apr 2025 10:31:56 -0600 Subject: [PATCH 1/2] ZEP-0026: Enhanced State Management Signed-off-by: Wayne Starr --- 0026-enhanced-state-management/README.md | 241 +++++++++++++++++++++++ 0026-enhanced-state-management/zep.yaml | 25 +++ 2 files changed, 266 insertions(+) create mode 100644 0026-enhanced-state-management/README.md create mode 100644 0026-enhanced-state-management/zep.yaml diff --git a/0026-enhanced-state-management/README.md b/0026-enhanced-state-management/README.md new file mode 100644 index 0000000..417724f --- /dev/null +++ b/0026-enhanced-state-management/README.md @@ -0,0 +1,241 @@ + + +# ZEP-NNNN: Your short, descriptive title + + + + + + +- [Summary](#summary) +- [Motivation](#motivation) + - [Goals](#goals) + - [Non-Goals](#non-goals) +- [Proposal](#proposal) + - [User Stories (Optional)](#user-stories-optional) + - [Story 1](#story-1) + - [Story 2](#story-2) + - [Risks and Mitigations](#risks-and-mitigations) +- [Design Details](#design-details) + - [Test Plan](#test-plan) + - [Prerequisite testing updates](#prerequisite-testing-updates) + - [Unit tests](#unit-tests) + - [e2e tests](#e2e-tests) + - [Graduation Criteria](#graduation-criteria) + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) + - [Version Skew Strategy](#version-skew-strategy) +- [Implementation History](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure Needed (Optional)](#infrastructure-needed-optional) + + +## Summary + +This ZEP proposes to improve Zarf's tracking of package and component state so that it can make smarter decisions about what to upgrade and what to remove. This would add tracking of Kubernetes objects that were created by a Zarf deployment as well as including more history of previous Zarf deployments similar to Helm. + +## Motivation + +Currently there are a few issues that limit what you can do with Zarf due to the way Zarf manages its state: + +1. Zarf tracks packages _only_ by their package name meaning you cannot have two deployments of the same package in the same cluster +1. If you force Zarf to install packages side by side (i.e. through the library) then you can only remove the last version of the package you installed +1. If a package removes a component from one version to the next then Zarf will lose track of that component during an upgrade +1. Zarf does not track the history of previous Zarf deployments giving less insight into what has been deployed in the past + +### Goals + +- Enable better tracking of resources created during a Zarf package deployment +- Enable history of Zarf deployments to be tracked + +### Non-Goals + +- Usurp Helm's lifecycle management of charts/objects deployed by Zarf (i.e. rollback) + +## Proposal + +The proposed solution is to split Zarf secrets into one for each version of a package + +### User Stories (Optional) + + + +#### Story 1 + +#### Story 2 + +### Risks and Mitigations + + + +## Design Details + + + +### Test Plan + + + +[ ] I/we understand the owners of the involved components may require updates to +existing tests to make this code solid enough prior to committing the changes necessary +to implement this proposal. + +### Graduation Criteria + + + +### Upgrade / Downgrade Strategy + + + +### Version Skew Strategy + + + +## Implementation History + + + +## Drawbacks + + + +## Alternatives + + + +## Infrastructure Needed (Optional) + + diff --git a/0026-enhanced-state-management/zep.yaml b/0026-enhanced-state-management/zep.yaml new file mode 100644 index 0000000..1ef9c99 --- /dev/null +++ b/0026-enhanced-state-management/zep.yaml @@ -0,0 +1,25 @@ +schema-version: 1.0.0 + +title: Enhanced State Management +zep-number: 0026 +authors: + - "@racer159" +status: provisional +creation-date: 2025-04-28 +reviewers: + - "@zarf-dev" +approvers: + - "@zarf-dev" + +# The target maturity stage in the current dev cycle for this ZEP. +stage: alpha + +# The most recent milestone for which work toward delivery of this ZEP has been +# done. This can be the current (upcoming) milestone, if it is being actively +# worked on. +latest-milestone: NA + +# The milestone at which this feature was, or is targeted to be, at each stage. +milestone: + alpha: "v0.39" + stable: "v1.0" From 3130169c531ce1359aaa3684a05af6c25fd0f52c Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Tue, 29 Apr 2025 12:14:02 -0600 Subject: [PATCH 2/2] refine proposal Signed-off-by: Wayne Starr --- 0026-enhanced-state-management/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0026-enhanced-state-management/README.md b/0026-enhanced-state-management/README.md index 417724f..a18c5aa 100644 --- a/0026-enhanced-state-management/README.md +++ b/0026-enhanced-state-management/README.md @@ -105,7 +105,7 @@ Currently there are a few issues that limit what you can do with Zarf due to the ## Proposal -The proposed solution is to split Zarf secrets into one for each version of a package +The proposed solution is to split Zarf secrets into one for each deployment of a package to track the changes that occur during each call of `zarf package deploy`. This is similar to how Helm works where each release of a chart is stored in a separate secret. Zarf would also change to label resources a package has created using the Helm post render logic. This would include both the package and the component name that created that resource. ### User Stories (Optional)