skaffold: "skaffold deploy" is not useful

I cannot figure out the use case for “skaffold deploy”.

This command is not able to populate the image tags. Without that, all it’s doing is corrupting the Deployments by deploying the tag-less images.

This command cannot use the result of “skaffold build” like this (as far as I know):

skaffold build > images.txt
skaffold deploy < images.txt

Without these functionality this command just appears like a kubectl apply that is not compatible with skaffold run to me.

Please consider either making “deploy” cmd work with “build” cmd or consider eliminating to avoid confusing users.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 16
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

My Implementation plan right now is

  • First fix skaffold build --output to write the produced build artifacts correctly. #1839
  • Support skaffold deploy to consume this output (--build-artifacts <build-output-file>)
    • [x ] Added #1869 to define input and output flag types.
    • Add flag --build-artifacts to skaffold deploy and get rid of --images. This is a mandatory flag.
  • Verify #1352 still exists and if it does, do not run skaffold build in skaffold deploy
  • ~Finally add support for git tagger or env tagger for skaffold build to tag images built.~ will track this as a new issue #2056

Follow-up ideas:

  • “explore inference use-cases”: figure out if skaffold deploy can infer --build-artifacts from git tagger or env tagger definition found in skaffold.yaml plus maybe leveraging the artifact cache locally

I think the right fix for this is that skaffold deploy should also generate the tag through the git commit tagger (or env tagger).

@rsanders yes, skaffold build already outputs the go template of the struct that deploy uses. Deploy should be able to read from that generated output

I imagine something like

skaffold build > build.out
# do some work
skaffold deploy --build-artifacts=build.out

or

skaffold build | skaffold deploy --build-artifacts -

or

skaffold build > build.out
# do some work
skaffold deploy --build-artifacts - < build.out

Could skaffold build write the build artifact names to an output file that is also read by skaffold deploy? I see that it has support for outputting those, but it leaves the plumbing as an exercise for the user.

We are using skaffold in our CD pipeline, and we like having “non-stable” components like build ID in the docker image tag. We also prefer to have separate build -> test -> deploy stages.

Eventually we might want to get rid of the “non-stable” taggers that rely on information from the build artifact itself

Adding the build.out is complicated (and unnecessary?) in this use case. We do continuous deployment so it’s ok for us to not have meaningful docker tags (eg. with version numbers).

The first thing we are going to address is deploy should be able to consume build output and its easier if we first implement a build.out based approach.

Will this use case be supported with the planned implementation?

@pepjo we mention your use case in follow up ideas where skaffold deploy can infer tags from git or an env variable.