-
Notifications
You must be signed in to change notification settings - Fork 771
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 support for Config, endpoint_mode and 3.3 support #994
Conversation
5f922e4
to
7d4d0fb
Compare
@cdrage @hangyan @surajnarwade
@cdrage @hangyan Pls review this PR if you are free. Review this PR maybe cost much time. If you have any comments , I will refactor my code. Thanks . :-) |
What's update on this ? Waiting it to be merged, so we can use it. |
20d79d5
to
5d919a7
Compare
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.
This is a great start! However, we really need to add more documentation.
With this PR, we are actually adding: Configuration support, 3.3 support as well as new key support (endpoint_mode for deploy).
Please:
- Update the conversion documentation (the table)
- Change the title of this PR (add support for Config, endpoint_mode and 3.3 support).
- Change your commit message (can be modified using
git commit --amend
If possible, could you also change this to three separate commits? (one for adding config support, one for adding deployment endpoint_mode support, and one for adding docker compose 3.3 support). I know it's a pain to do, but maybe @hangyan could help you?
Many thanks! 👍
noSupKeys := checkUnsupportedKeyForV3(config) | ||
for _, keyName := range noSupKeys { | ||
log.Warningf("Unsupported %s key - ignoring", keyName) | ||
} |
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.
👍
deploy: | ||
mode: replicated | ||
replicas: 2 | ||
endpoint_mode: vip |
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.
this needs to be added to the documentation: http://kompose.io/conversion/
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.
Done @cdrage
pkg/loader/compose/v3.go
Outdated
keysFound = append(keysFound, "credential_spec") | ||
} | ||
if service.Deploy.EndpointMode == "dnsrr" { | ||
keysFound = append(keysFound, "dnsrr") |
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.
A bit confused, we're manipulating "vip" and that makes sense (using an IP endpoint). But what is the Kubernetes equivalent with dnsrr
?
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.
@cdrage dnsrr
means user can use service name
to connect, so in k8s, a normal service
type can connect through service name
. Change code to that, dnsrr
convert to a normal service type.
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.
ah, that makes sense. thank you.
@cdrage Sure. I am current working on the secret support, separate the commit can also reduce the potentially conflict |
@cdrage Any update ? |
docs/conversion.md
Outdated
@@ -4,7 +4,7 @@ This document outlines all possible conversion details regarding `docker-compose | |||
|
|||
The current table covers all **current** possible Docker Compose keys. | |||
|
|||
__Note:__ due to the fast-pace nature of Docker Compose version revisions, minor versions such as 2.1, 2.2, 3.3 are not supported until they are cut into a major version release such as 2 or 3. | |||
__Note:__ due to the fast-pace nature of Docker Compose version revisions, minor versions such as 2.1, 2.2 are not supported until they are cut into a major version release such as 2 or 3. |
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.
Go ahead and completely remove this line.. We should simply state that we don't support anything 3.4 and above at the moment.
pkg/loader/compose/v3.go
Outdated
keysFound = append(keysFound, "credential_spec") | ||
} | ||
if service.Deploy.EndpointMode == "dnsrr" { | ||
keysFound = append(keysFound, "dnsrr") |
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.
ah, that makes sense. thank you.
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.
Other than one small comment, this LGTM. Although this is a big PR. Could you have a quick-look @hangyan before we merge?
A few thoughts:
|
|
|
@cdrage Please take a look at my reviews and share some of your thoughts on this |
Need your opinion @cdrage |
ba97063
to
5892a51
Compare
@cdrage @hangyan Discuss with @hangyan , I change some code for this pr:
Now this PR has become a Thanks all for your review. |
64592be
to
dccb995
Compare
@cdrage
Now we need @cdrage opinion to push this pr going on. Hope you have time to see this and give us some advice. So we can merge this important pr soon. :-) Many thanks. |
@xianlubird For NodePort it's actually the user can visit any node port. You still have to figure out the IP. network_mode: vip in my opinion is closer to LoadBalancer. I agree however with I will do another review in the next few days! |
@cdrage any update on this ? ......... |
@xianlubird @cdrage I have re-check the kubernetes documents, it seems like subPath(https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath) can bring the full support for compose |
@hangyan any progress? |
@hangyan @xianlubird Minor conflicting file, otherwise this LGTM. I can do another review after the conflicted file is resolved! |
50b522a
to
45f017d
Compare
@cdrage All check have passed. conflicting solved. |
@xianlubird As i have point out before, subPath can bring the full support for compose config, otherwise this PR is too limited. @cdrage Or we can merge this first and create a new one to improve it |
@hangyan Adding subPath may be best before merging, so that Although to be honest, 3.3 support seems to be important as well as endpoint_mode. Maybe we should merge and then open an issue indicating that we should implement subPath / syntax support for config. |
@cdrage Let's merge this first so we can move on |
@hangyan I agree. It's been way too long. Any issues that we encounter in the future can be resolved. Merging this massive PR. Special thanks to @xianlubird ! 💯 |
Docker compose v3.3 add four attributes. For
credential_spec
we shouldn't support. I will work on it , support v3.3 ASAP.Issue: #914 and #865
@cdrage