GoogleContainerTools / GoogleContainerTools/skaffold
Multiple or per artifact tagPolicy's
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
### Use Case
We're developing a service that creates Kubernetes Job's. Both the service and the job are under very active development.
Both the image for the service and the image for the job are listed in skaffold's "artifacts" section. Only the service artifact is referenced in the k8s manifests, the manifest for all jobs are dynamically generated by the service
If tagPolicy is set to gitCommit, then skaffold does a great job of keeping the service deployment up to date, rolling the deployment whenever any source changes.
If tagPolicy is set to envTemplate: "{{ IMAGE_NAME }}:latest", then skaffold does a great job of keeping the job image built. Whenever we ask the service to start a job, it starts the job running an up to date image.
### The Ask
I can think of several different ways to solve my use case:
- allow multiple tagPolicy's to be set. If a user has set multiple tagPolicy's, apply multiple tags to the artifact. You'd may need some magic or an explicit flag to determine which tagPolicy to use in the manifests.
- additionally tag all artifacts with `{{ IMAGE_NAME }}:latest` to make it easier for us and for anybody other sorts of ad-hoc stuff. (perhaps behind a flag).
- allow tagPolicy to be set per artifact as well as per profile
- some sort of mechanism so that the service can determine what tag skaffold has created for the images it builds
### Information
- Skaffold version: version 0.18.0
- Operating system: Ubuntu 18.04
- Contents of skaffold.yaml:
```yaml
apiVersion: skaffold/v1alpha5
kind: Config
build:
artifacts:
- image: app
docker:
dockerfile: app/Dockerfile
- image: files
docker:
dockerfile: files/Dockerfile
- image: projects
docker:
dockerfile: projects/Dockerfile
- image: users
docker:
dockerfile: users/Dockerfile
- image: worker
docker:
dockerfile: worker/Dockerfile
profiles:
- name: dev-shared
build:
artifacts:
- image: dev
docker:
dockerfile: docker/dev-shared/Dockerfile
deploy:
kustomize:
path: skaffold/dev-shared
- name: pr
build:
tagPolicy:
envTemplate:
template: '{{.DOCKER_REGISTRY}}/threekit-com/{{.IMAGE_NAME}}:{{.VERSION}}'
deploy:
kustomize:
path: skaffold/pr
- name: dev-full
deploy:
kustomize:
path: skaffold/dev-full
```
Contributor guide
Assessment
This issue has not been assessed yet.