-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[FLINK-16600][k8s] Fix not respecting the RestOptions.BIND_PORT for the Kubernetes setup #11705
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 005f751 (Sat Apr 11 02:56:04 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
@flinkbot run travis |
@flinkbot run azure |
@tisonkun @tillrohrmann @wangyang0918 Could you help take a look at this PR? Thanks a lot in advance! |
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.
I don't think such a change verified by "existing" tests. If the configuration isn't respect, you should point out/add a specific test failed without this change and pass with it.
The changes looks good to me. I agree with @tisonkun that we need to add a new test, which will fails before the changes and pass after it.
|
Hi, @tisonkun @wangyang0918 Thanks for your review and comments. The test case of |
005f751
to
75e3de0
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.
Could you add a new test and make sure we test with and without setting BIND_PORT.
As you change existing test, our test coverage has been downgraded.
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.
With a quick offline discussion with @zhengcanbin I get the point that the existing test org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecoratorTest#testBuildAccompanyingKubernetesResources
will fail with production code changes because we now always set targetPort
which follows K8s best practice.
So the change of existing test is for respect this change and accidentally we configure BIND_PORT so that verify exactly the BIND_PORT is set. The fallback logic should be guarded by RestOption's tests themselves.
@wangyang0918 does this explanation make sense to you?
@tisonkun @zhengcanbin I have checked the test and changes again. If we set Now i give the pass, +1 for merging. |
What is the purpose of the change
Our current logic only takes care of RestOptions.PORT but not RestOptions.BIND_PORT, which is a bug; for example, when one sets the RestOptions.BIND_PORT to a value different from RestOptions.PORT, jobs could not be submitted to the existing session cluster deployed via the kubernetes-session.sh.
This PR fixes the bug.
Brief change log
Set the RestOptions.BIND_PORT as the target port of the external Service.
Verifying this change
This change can be tested via the existing unit tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation