Skip to content
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 arg min-port=1024 to dnsmasq container in kube-dns #7020

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

nr17
Copy link
Contributor

@nr17 nr17 commented May 17, 2019

Do not use ports less than that given as source for outbound DNS queries. Dnsmasq picks random ports as source for outbound queries: when this option is given, the ports used will always to larger than that specified. Useful for systems behind firewalls.

More information: Kubernetes kube-dns uses dnsmasq version 2.78 (http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.78.tar.xz), which doesn't set the default min_port to 1024 (probably a bug). Later versions of dnsmasq have fixed this issue and don't need explicit min-port command-line argument.

@k8s-ci-robot
Copy link
Contributor

Hi @nr17. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 17, 2019
@nr17
Copy link
Contributor Author

nr17 commented May 17, 2019

/assign @andrewsykim

@fejta-bot
Copy link

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/check-cla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 17, 2019
@nr17
Copy link
Contributor Author

nr17 commented May 29, 2019

@andrewsykim Any feedback for me?

@nr17
Copy link
Contributor Author

nr17 commented May 30, 2019

@justinsb @mikesplain can you please provide some comments on this pr.

@andrewsykim
Copy link
Member

/ok-to-test

If later versions of dnsmasq started to default --min-port=1024 then lgtm. @nr17 do you know which version of dnsmaq added this default?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 21, 2019
@nr17
Copy link
Contributor Author

nr17 commented Jun 21, 2019

/ok-to-test

If later versions of dnsmasq started to default --min-port=1024 then lgtm. @nr17 do you know which version of dnsmaq added this default?

They fixed it in version 2.79 with this change:

  • baf553d Default min-port to 1024 to avoid reserved ports. (1 year, 5 months ago)

@nr17
Copy link
Contributor Author

nr17 commented Jun 21, 2019

/ok-to-test
If later versions of dnsmasq started to default --min-port=1024 then lgtm. @nr17 do you know which version of dnsmaq added this default?

They fixed it in version 2.79 with this change:

  • baf553d Default min-port to 1024 to avoid reserved ports. (1 year, 5 months ago)

Their changelog doesn’t mention it explictly. I had to do a git log to find it.
http://www.thekelleys.org.uk/dnsmasq/CHANGELOG

git clone git://thekelleys.org.uk/dnsmasq.git
dnsmasq (master) $ git log --graph --pretty=format:"%C(green)%h%Creset%C(red)%d%Creset %s %C(bold blue)<%an>%Creset %C(green)(%cr)" --abbrev-commit | grep min-port

  • baf553d Default min-port to 1024 to avoid reserved ports. (1 year, 5 months ago)
    dnsmasq (master) $

You can verify the version in which it was fixed by examining the git log using : git log --graph --pretty=format:"%C(green)%h%Creset%C(red)%d%Creset %s %C(bold blue)<%an>%Creset %C(green)(%cr)" --abbrev-commit

@andrewsykim
Copy link
Member

Thanks for verifying @nr17.

/lgtm
/assign @justinsb

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2019
@justinsb
Copy link
Member

Thanks @nr17 and sorry for the delay... it's a tricky one to figure out, but worst case this matches the default that will be set when we (eventually) update dnsmasq! I'm not entirely sure how you found it :-)

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, nr17

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2019
@rifelpet
Copy link
Member

rifelpet commented Sep 19, 2019

/test pull-kops-bazel-test
/test pull-kops-verify-gomod

@rifelpet
Copy link
Member

@nr17 can you update these manifest hashes with their new values according to the failed pull-kops-bazel-test job's output?

@nr17 nr17 force-pushed the add-arg-min-port-to-dnsmasq branch from d109186 to b97b9e4 Compare September 20, 2019 17:50
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 20, 2019
@nr17 nr17 force-pushed the add-arg-min-port-to-dnsmasq branch from b97b9e4 to 241f9dd Compare September 20, 2019 18:10
@nr17
Copy link
Contributor Author

nr17 commented Sep 20, 2019

/test pull-kops-bazel-test

@nr17
Copy link
Contributor Author

nr17 commented Sep 20, 2019

@rifelpet I changed the manifest hashes in upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/manifest.yaml but the tests still fail.
I see that the hashes are present in upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/kopeio-vxlan/manifest.yaml, upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/manifest.yaml and upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml as well.
Need to change all ?

@rifelpet
Copy link
Member

@nr17 ah yes you'll probably need to update them all. I believe the hack/update-expected.sh script will update them for you too.

Do not use ports less than that given as source for outbound DNS queries. Dnsmasq picks random ports as source for outbound queries: when this option is given, the ports used will always to larger than that specified. Useful for systems behind firewalls.
@nr17 nr17 force-pushed the add-arg-min-port-to-dnsmasq branch from 241f9dd to 0310c2e Compare September 20, 2019 18:53
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 20, 2019
@nr17
Copy link
Contributor Author

nr17 commented Sep 21, 2019

@justinsb can I get the final approval for this. I corrected the manifest hashes for the updated yamls.

@andrewsykim
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 25, 2019
@k8s-ci-robot k8s-ci-robot merged commit f23481f into kubernetes:master Sep 25, 2019
k8s-ci-robot added a commit that referenced this pull request Oct 1, 2019
…-origin-release-1.15

Automated cherry pick of #7020: Add arg min-port=1024 to dnsmasq container in kube-dns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants