GoogleContainerTools / GoogleContainerTools/skaffold
`skaffold build` should build and push Helm charts
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
Request from @eshepelyuk on [our `#skaffold` channel](https://kubernetes.slack.com/archives/CABQMSZA6/p1635576944038100): Skaffold should support creating a Helm package (.tgz), and to also push a chart to a registry.
Skaffold already [generates a Helm package](https://github.com/GoogleContainerTools/skaffold/blob/2551171e173df4cfaf37a6cd317be6ba5bcd11ec/pkg/skaffold/deploy/helm/deploy.go#L610-L611) (a .tgz file) as a side-effect of branding the chart with a version or appVersion, but this is only done on `deploy` and the package is written out to `$TMPDIR`. This requires deploying the chart to a cluster, but @eshepelyuk does not actually want to the chart.
Helm 3.7 introduced `helm push` to push the package to an OCI-compliant registry.
----
I propose the following:
1. The `skaffold.yaml`'s [`deploy.helm.releases.packaged`](https://skaffold.dev/docs/references/yaml/#deploy-helm-releases-packaged) should support two additional fields:
1. `local` should specify a local directory (created if necessary) where packages should be saved locally.
2. `repo` should specify a remote repository to which to push the packages.
1. When `packages.repo` is set and `build.local.push = true`, then `skaffold build` (not `deploy`) should build and save and push Helm packages. This destination should be affected by `--default-repo`.
1. Since `helm install` / `helm upgrade` is always run locally for the deploy, the Helm package should always be created locally even when the build-environment is set to GCB or a cluster build.
1. The pushed chart should be recorded in the artifacts.json.
Contributor guide
Assessment
This issue has not been assessed yet.