Add --compose-file option to skaffold init#1282
Merged
nkubala merged 3 commits intoGoogleContainerTools:masterfrom Nov 16, 2018
Merged
Add --compose-file option to skaffold init#1282nkubala merged 3 commits intoGoogleContainerTools:masterfrom
nkubala merged 3 commits intoGoogleContainerTools:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1282 +/- ##
==========================================
- Coverage 44.3% 44.24% -0.06%
==========================================
Files 104 104
Lines 4623 4629 +6
==========================================
Hits 2048 2048
- Misses 2366 2372 +6
Partials 209 209
Continue to review full report at Codecov.
|
balopat
reviewed
Nov 15, 2018
| if composeFile != "" { | ||
| // run kompose first to generate k8s manifests, then run skaffold init | ||
| logrus.Infof("running 'kompose convert' for file %s", composeFile) | ||
| komposeCmd := exec.Command("kompose", "convert", "-f", composeFile) |
Contributor
There was a problem hiding this comment.
do we have a preference around supported version for kompose?
Contributor
Author
There was a problem hiding this comment.
just added it to the dockerfile with a pinned version. I only tried with the latest (v1.17.0), but I'm assuming any older version that does what it's supposed to do will work with skaffold.
balopat
approved these changes
Nov 15, 2018
Contributor
balopat
left a comment
There was a problem hiding this comment.
LGTM, this is nice and simple :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
--compose-fileflag toskaffold init, which enables users to quickly get started with skaffold with a docker-compose application. The flag simply runskompose converton the docker-compose file, which generates kubernetes manifests in the application directory, and then runsskaffold initas normal to generate a skaffold.yaml.#674 already took a stab at adding direct compose file support, and was closed since there wasn't consensus around the implementation. I also had issues vendoring in
kubernetes/kompose, but the precedent for shelling out to k8s-related binaries has already been set with kustomize, so I think this is ok.We can also extend this to a
ComposeDeployer(a la what @r2d4 had in #674) if we want to go that route, depending on what people want, but I think at the very least it makes sense ininit.Fixes #1195