GoogleContainerTools / GoogleContainerTools/skaffold

[Feature Request] add explicit 'dependencies' field for manifests rendering and deploying

Open
#9,069 0 comments 0 reactions 0 assignees View on GitHub
kind/feature-request priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Skaffold is an amazing tool, thanks for the great work!

I'm using manifest hooks to run `kustomize | envsubst` to render a raw YAML, and let skaffold deploy that raw YAML for me.
```yaml
manifests:
rawYaml:
- env/dev/k8s/generated-overlay.yaml
hooks:
before:
- host:
command:
- bash
- -c
- 'eval "$(direnv export bash)"; kubectl kustomize | envsubst > generated-overlay.yaml'
dir: env/dev/k8s/app
```

I don't appreciate the 'no env vars' philosophy of vanilla kustomize cause that would HUGELY complicates my use case, so I'm sticking with `kustomize | envsubst` and it serves me very well.

The issue is that skaffold don't know the dependencies of my manually generated raw YAML, so when the source manifests change, it would not re-render and re-deploy the manifests.

I see that the build phase got a `dependencies` field allowing users to explicitly specify what files to watch and rebuild, so are there any similar things for manifests and deploy phase? If not, I think this might be a good idea, as it allow the users like me to use more powerful workflow beyond the default kustomize/helm.

### Expected behavior

My proposal:

```yaml
manifests:
rawYaml:
- env/dev/k8s/generated-overlay.yaml
hooks:
before:
- host:
command:
- bash
- -c
- 'eval "$(direnv export bash)"; kubectl kustomize | envsubst > generated-overlay.yaml'
dir: env/dev/k8s/app
dependencies:
paths:
- env/base-layer/**.yaml
```

`skaffold dev` would watch for all the dependencies in base-layer, when they change, trigger a re-render and re-deploy.

### Actual behavior

Nothing happens for now.

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.