-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"skaffold deploy" is not useful #922
Comments
I agree that this command is not working well. |
The use case would be to use |
See also #653 |
Yeah, I just picked up on this too. I thought I could `
While the build command is able to build an image with the correct tag, using an environment variable and envTemplate, the deploy command just ignore this all together. |
I think the right fix for this is that |
Eventually we might want to get rid of the "non-stable" taggers that rely on information from the build artifact itself |
Could 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. |
@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
or
or
|
cc @tejal29 |
I can't agree with this, i use |
My Implementation plan right now is
Follow-up ideas:
|
Is this issue linked to this one: #1352 ? |
So with the changes as described above this is how the workflow will look like
( Note: untill we support git tagger or env tagger artifacts listed in build.out with be digest based)
Note: @dgageot and @balopat, i feel,
Maybe we could an explicit flag to build like:
What do you think? |
1. Inputfilepath: Inputfilepath flag, makes sure the file present exists. 2. Outputfilepath: Outputfilepath flag does not do any validation right now. Motivation: For, GoogleContainerTools#922 I am going to add `--build-output` as new flag to `skaffold build` to dump all artifacts built with with their tags. Similarly, the deploy will have additional flag `--build-artifacts` which will point to the output written by `skaffold build --build-output <file>` The Inputfilepath, can also be used to replace all the places where we expect an input file without repeating validation. ``` (add_flag_to_deploy)$ git grep 'Filename or URL to the pipeline' cmd/skaffold/app/cmd/cmd.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") cmd/skaffold/app/cmd/diagnose.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") cmd/skaffold/app/cmd/fix.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") cmd/skaffold/app/cmd/init.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") ```
1. Inputfilepath: Inputfilepath flag, makes sure the file present exists. 2. Outputfilepath: Outputfilepath flag does not do any validation right now. Motivation: For, GoogleContainerTools#922 I am going to add `--build-output` as new flag to `skaffold build` to dump all artifacts built with with their tags. Similarly, the deploy will have additional flag `--build-artifacts` which will point to the output written by `skaffold build --build-output <file>` The Inputfilepath, can also be used to replace all the places where we expect an input file without repeating validation. ``` (add_flag_to_deploy)$ git grep 'Filename or URL to the pipeline' cmd/skaffold/app/cmd/cmd.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") cmd/skaffold/app/cmd/diagnose.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") cmd/skaffold/app/cmd/fix.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") cmd/skaffold/app/cmd/init.go: cmd.Flags().StringVarP(&opts.ConfigurationFile, "filename", "f", "skaffold.yaml", "Filename or URL to the pipeline file") ```
I am trying to understand the need for this when trying to deploy with an image that has already been built:
Our current planned use case is:
Adding the Will this use case be supported with the planned implementation? |
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
@pepjo we mention your use case in follow up ideas where |
Thanks, I did not see that particular part of the comment. Thanks for the answer. |
For GoogleContainerTools#922, i am making changes to `skaffold deploy` to not run `skaffold build`. `--images` flag is only used `deploy` flow. The way it works is when `--images` flag is present, runner creates a `PreBuiltImageBuilder`. All it does is, parses the images and converts them to build.Artifact. If during deploy, an image in the list was also built, then it uses the built image tag vs the tag present on the commmand line flag. In this change, we remove creating a PreBuiltImageBuilder in the runner. (Remember this flag is only available for deploy and hence other command won't get affected) The `--images` will now be converted to build.Artifact in the runner.Deploy flow.
For GoogleContainerTools#922, i am making changes to `skaffold deploy` to not run `skaffold build`. `--images` flag is only used `deploy` flow. The way it works is when `--images` flag is present, runner creates a `PreBuiltImageBuilder`. All it does is, parses the images and converts them to build.Artifact. If during deploy, an image in the list was also built, then it uses the built image tag vs the tag present on the commmand line flag. In this change, we remove creating a PreBuiltImageBuilder in the runner. (Remember this flag is only available for deploy and hence other command won't get affected) The `--images` will now be converted to build.Artifact in the runner.Deploy flow.
For GoogleContainerTools#922, i am making changes to `skaffold deploy` to not run `skaffold build`. `--images` flag is only used `deploy` flow. The way it works is when `--images` flag is present, runner creates a `PreBuiltImageBuilder`. All it does is, parses the images and converts them to build.Artifact. If during deploy, an image in the list was also built, then it uses the built image tag vs the tag present on the commmand line flag. In this change, we remove creating a PreBuiltImageBuilder in the runner. (Remember this flag is only available for deploy and hence other command won't get affected) The `--images` will now be converted to build.Artifact in the runner.Deploy flow.
1. Add kubectl apply command after setting labels 2. Integration tests for helms are back a. GoogleContainerTools#1823: Use env template in skaffold release name 3. During helm deploy, build is assumed and hence if no build-artifacts are supplied, it fails with following error "no build present for gcr.io/k8s-skaffold/skaffold-helm" Since Build and Deploy are now separate ( GoogleContainerTools#922 for notes) use the image value as is if not present as build artifacts TODO: 1. Add PR description 2. Figure out why we get 2 pods, 1 with valid labels which is running but another 1 with different labels.
1. Add kubectl apply command after setting labels 2. Integration tests for helms are back a. GoogleContainerTools#1823: Use env template in skaffold release name 3. During helm deploy, build is assumed and hence if no build-artifacts are supplied, it fails with following error "no build present for gcr.io/k8s-skaffold/skaffold-helm" Since Build and Deploy are now separate ( GoogleContainerTools#922 for notes) use the image value as is if not present as build artifacts Fix test fot this. TODO: 1. Add PR description 2. Figure out why we get 2 pods, 1 with valid labels which is running but another 1 with different labels.
1. Add kubectl apply command after setting labels 2. Integration tests for helms are back a. GoogleContainerTools#1823: Use env template in skaffold release name 3. During helm deploy, build is assumed and hence if no build-artifacts are supplied, it fails with following error "no build present for gcr.io/k8s-skaffold/skaffold-helm" Since Build and Deploy are now separate ( GoogleContainerTools#922 for notes) use the image value as is if not present as build artifacts Fix test fot this. TODO: 1. Add PR description 2. Figure out why we get 2 pods, 1 with valid labels which is running but another 1 with different labels.
On master, skaffold deploy fails with following error. ``` skaffold deploy -f examples/helm-deployment/skaffold.yaml Starting deploy... Error: release: "skaffold-helm" not found Helm release skaffold-helm not installed. Installing... FATA[0002] deploying skaffold-helm: matching build results to chart values: no build present for gcr.io/k8s-skaffold/skaffold-helm ``` This is because in GoogleContainerTools#922, we removed deploy triggering the build. Running deploy should use the default tag i.e. "latest" when depoying images.
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):
Without these functionality this command just appears like a
kubectl apply
that is not compatible withskaffold run
to me.Please consider either making "deploy" cmd work with "build" cmd or consider eliminating to avoid confusing users.
The text was updated successfully, but these errors were encountered: