GoogleContainerTools / GoogleContainerTools/skaffold

Feature: Skaffold config field to disable cleanup after dev/debug (vs just the flag `--cleanup=false`)

Open
#8,288 4 comments 0 reactions 0 assignees View on GitHub
area/cleanup area/config deploy/helm kind/feature-request kind/friction priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

It would be nice if there would be an option to disable the cleanup actions that delete everything that was created.

## Context

So I have a dev kubernetes cluster setup that out of the box has all the required helm charts configured with the appropriate values. I'm not using skaffold to deploy the helm charts but terraform instead.

Now, I want to use skaffold to transparently overwrite specific helm charts in the cluster during development reusing everything that is already present in the cluster.
FOr that I added (replacing real names with "test"):
```yaml
#...
deploy:
helm:
releases:
- name: test
namespace: default
chartPath: charts/test
wait: true
setValueTemplates:
image.repository: "{{.IMAGE_REPO_test}}"
image.tag: "{{.IMAGE_TAG_test}}@{{.IMAGE_DIGEST_test}}"
flags:
install: ["--you-should-not-do-this"] # install should never be used
upgrade: ["--reuse-values"]
```
Here I'm using the helm flags to fail on installs and reuse existing values from the cluster during upgrades.
This works like a charm if I'm simply running `skaffold run`.

## Currently

When running `skaffold dev` or `skaffold debug` instead it also works fine but in the end every helm release that was just upgraded in the beginning is just uninstalled.

Therefore, I basically have to rerun my terraform code containing all the values every time I quit debug or dev mode.

## Potentially

So it would be nice if I could just disable the cleanup at the end of a dev cycle.
Maybe it could be even further improved by just rolling back a helm release instead of deleting it at the end of a dev cycle in case the dev cycle started with an upgrade and not an install (probably could be implemented by looking at the revision number also).

## skaffold version
v2.0.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.