Skip to content

Feature request: Support --prune feature when execute zarf package deploy to delete needless helm chart or manifest #2992

@Miaoxiang-philips

Description

@Miaoxiang-philips

Is your feature request related to a problem? Please describe.

No.

Describe the solution you'd like

Day 1: I defined my application's Helm charts and images using zarf.yaml, then packaged them into a .zst archive. I deployed it to my cluster in an air-gapped environment, and it worked very well
like this:

kind: ZarfPackageConfig
metadata:
  name: example-app
  description: Deploy example application
  version: 0.1.1
  architecture: amd64

components:
  - name: app-gateway
    required: true
    charts:
      - name: app-gateway
        version: 1.0.2
        namespace: app-gateway
        url: https://xxx.com/artifactory/helm-dev/
        releaseName: app-gateway
        valuesFiles:
          - helm-values/values-app-gateway.yaml
      - name: httpd
        version: 10.0.1
        namespace: httpd
        url: https://xxx.com/artifactory/helm-dev/
        releaseName: httpd
        valuesFiles:
          - helm-values/values-httpd.yaml
    images:
      - xxx.com/app-gateway:v1.1
      - httpd:alpine3.18

Day 2: My application was updated, but only some images and manifests were changed. I repackaged my Zarf package, from 0.1.1 to 0.1.2, and executed zarf package deploy to deploy it to the cluster. It worked very well.

Day 3: My application was updated again, with more changes this time. I needed to remove the httpd Helm chart, so I created a new Zarf package, from 0.1.2 to 0.2.0, and executed zarf package deploy again. However, the resources associated with the httpd Helm chart were not deleted.

If this was the manifest file, I think it would be the same

Therefore, I wonder if it's possible to add a --prune option to zarf package deploy to support the deletion of unnecessary resources from the new version of the package.

This may also be integrated with the zarf tools registry prune to automatically upgrade applications and clean up unwanted resources

Describe alternatives you've considered

Of course, I can define different Helm charts and manifests as separate components and then use zarf package remove --component to delete specific components.

However, this is somewhat cumbersome. It would be more convenient if zarf.yaml could provide a way to declare certain components to be removed before deployment. This way, zarf package deploy could automatically remove those components, making the process more convenient.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

PR Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions