-
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
Add --compose-file option to skaffold init #1282
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.
|
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a preference around supported version for kompose
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is nice and simple :)
This adds a
--compose-file
flag toskaffold init
, which enables users to quickly get started with skaffold with a docker-compose application. The flag simply runskompose convert
on the docker-compose file, which generates kubernetes manifests in the application directory, and then runsskaffold init
as 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